Store
Last updated
Last updated
The Store is holds the state, and is responsible for change of state. You can also subscribe to a store for changes.
import reim from 'reim'
const todoStore = reim({
todos: []
})
export default todoStore
A store is anonymous by default. You can create a named store for use with plugins e.g. reim-reporter.
const todoStore = reim({
todos: []
}, {
name: 'Todo-Store'
})
You can easily apply plugins on store
import react from 'react-reim'
const store = reim({message: ''}, {
plugins: [react()]
})
or after it is initialized
const store = reim({}).plugin(persist())