Lape

Lape

  • Docs
  • GitHub

›API

Getting Started

  • Getting Started
  • Thinking in Lape

API

  • lape
  • connect
  • useLape
  • useLapeEffect
  • undo / redo
  • ignoreState
  • lapeTrackUseState

Guides

  • Testing
  • Routing

connect

connect wraps your components to track what state the component uses and rerenders the component when that state was mutated.

It's recommended to wrap as many components as you can for optimisation, but wrapping only root component would work as well.

Example

import React from 'react'
import { connect } from 'lape'
import state from './state'

const Component = () => {
  const onClick = () => state.count += 1;
  
  return <div onClick={onClick}>{state.count}</div>
}

export default connect(Component)
← lapeuseLape →
  • Example
Lape
Docs
Getting StartedAPI ReferenceGuides
Other Projects
Ugnis
More
GitHubStar
Copyright © 2021 Ugnis. All Rights Reserved.