Store
Simple store that can be hooked into React.
Source code is hosted on GitHub
Seamless React integration is shipped in a separate package:
useStoreThere is a version of this package that syncs directly to the localStorage
:
createStore()
Creates a new instance of observable store:
Create a new instance without the factory function:
Create a new instance with a custom differ:
Store.get()
Retrieve everything from the store:
Store.set()
Replace everything in the store:
Store.put()
Update store by merging new and old state:
Store.listen()
Listen to changes:
Listen to changes with a custom differ:
Listen to a subset of data, using a custom mapper:
Store.use()
Convenience method for people used to React's useState
syntax:
Last updated