Created
November 5, 2018 20:01
-
-
Save ctrlplusb/604d8a2f24fa6195abff3e7df08c83f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore } from 'easy-peasy'; | |
// Pass in your model and you get back a Redux store | |
const store = createStore(model); | |
// you can query state as normal | |
store.getState().todos.items; | |
// ['Install easy-peasy'] | |
// and dispatch actions | |
store.dispatch.todos.add('Build an app') | |
// |---------| | |
// |- Actions are bound to a path matching model | |
// and access the other standard APIs of a Redux store | |
store.listen(() => console.log('An update occurred')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment