dispatch
const store = new NgStore({foo: true});
// Get the latest value of foo
let foo = store.copy('foo');
// Toggle the foo from store
// {foo: false}
store.dispatch('TOGGLE_FOO', {foo: !foo});const store = new NgStore({foo: true});
// Toggle the foo from store
// {foo: false}
store.dispatch('TOGGLE_FOO', (state) => {
return {foo: !state.foo};
});Last updated
Was this helpful?