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