Structured data store for MobX. Partially influenced by Backbone Collections.
Can be used with Redux DevTools.
;const collection = ;const john = collection;const jane = collection;console; // 2johnlastName = 'Williams';console; // 'Williams'
To install, use
yarn. The lib has a peer dependency of
mobx 2.7.0 or later (including MobX 3).
npm install mobx-collection-store mobx --save
yarn add mobx-collection-store mobx
Since the lib is exposed as a set of CommonJS modules, you'll need something like webpack or browserify in order to use it in the browser.
Don't forget to prepare your code for production for better performance!
The main idea behind the library is to have one instance of the collection that contains multiple model types. This way, there can be references between models that can handle all use cases, including circular dependencies.
- Defining models
- Configuring the collection
- Using the collection
- Persisting data locally
- Redux DevTools
The library contains the following elements:
The MIT License
mobx-collection-store is maintained and sponsored by Infinum.