An isomorphic JavaScript library that acts as an in memory data store for JSON API data. Changes are broadcast using RxJS. Built to work with React.
Usage
Browser
At the moment the primary use can for JSON API Store is in the browser:
// Create a new store instance.var adapter = base: "/api/v1" ;var store = adapter; // Define the "categories" type.store; // Define the "products" type.store; // Subscribe to events using RxJS.storeobservable; // Load all the products.store;
Node
You can also use JSON API Store in a Node.js environment (currently, there aren't any adapters that work in a Node.js):
NOTE: Without an adapter the CLUD methods (create
, load
, update
and
destroy
) cannot be used.
var Store = ; var store = ; store; store; store; store; storecategorytitle; // "Example Category"
Documentation
Full documentation is available on the website:
http://particlesystem.com/json-api-store/
Installing
NPM
npm i json-api-store
Bower
bower i json-api-store
Download
To use directly in the browser you can grab the store.prod.js file.