@hellomonday/state
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@hellomonday/state

A simple module for state management. Add key/value pairs and listen to changes on the key's value.

Install

$ npm install --save @hellomonday/state

Usage

  const CURRENT_SECTION = 'currentSection';
  const state = new State();

  state.on(CURRENT_SECTION, async (state: any) => {
    // The state will return 'current' and 'previous' values
    state.previous.animateOut();
    state.current.animateIn();
  });

  state.setValue(CURRENT_SECTION, new Home());

License

MIT © Hello Monday

Readme

Keywords

none

Package Sidebar

Install

npm i @hellomonday/state

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

8.07 kB

Total Files

5

Last publish

Collaborators

  • anderssjessen
  • johnnyslack
  • supermoos
  • terkelg
  • virgilspruit
  • zerguei