reim-persist
Last updated
Last updated
import persist from 'react-persist'
reim-persist saves a Reim store's state to localstorage
persist
persist(options: Object) => func
Will get state from localstorage on initialization, and on state change it will write to localstorage.
You can use custom storage by providing storage
option:
Note the customStorage
must have setItem
and removeItem
options
const store = reim({}).plugin(persist())
persist({
storage: customStorage // your custom storage
})