lape
TypeScript icon, indicating that this package has built-in type declarations

6.4.8 • Public • Published

Lape

ugnissoftware.github.io/lape/

Simple state manager for React built on Proxies.

Supports only the latest browsers.

Example

// STATE.ts
import { lape } from "lape";

export interface State {
  count: number;
  deep: {
    nest: boolean;
  };
}

const defaultState: State = {
  count: 0,
  deep: {
    nest: true,
  },
};

export default lape(defaultState);
// APP.tsx
import { connect } from "lape";
import state from "./state";

const action = () => {
  state.count += 1;
};

class App extends React.Component {
  render() {
    return <div onClick={action}>{state.count}</div>;
  }
}

export default connect(App);

/lape/

    Package Sidebar

    Install

    npm i lape

    Weekly Downloads

    268

    Version

    6.4.8

    License

    MIT

    Unpacked Size

    55.6 kB

    Total Files

    35

    Last publish

    Collaborators

    • ugnis