iom
v2.1.1
Published
🐣🔤🚀Tiny, simple, over-powered state management
Downloads
23
Readme
import Store from 'iom';
const INITIAL_STATE = { on: false };
const store = new Store(INITIAL_STATE);
const subscriber = console.log;
const cancel = store.subscribe(subscriber);
// => { on: false }
const toggleOn = state => ({ ...state, on: !state.on });
store.update(toggleOn);
// => { on: true }
cancel();