@hellomonday/state
v1.0.3
Published
A simple module for state management
Downloads
28
Keywords
Readme
@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