json-api-store
json-api-store copied to clipboard
An isomorphic JavaScript library that acts as an in memory data store for JSON API data.
``` javascript var store = new Store(); store.define("products", { title: Store.attr(), category: Store.hasOne(), comments: Store.hasMany() }); store.describe("products"); // { // fields: [ "title", "category", "comments" ], // attributes: [ "title"...
The default behaviour of find should not actually create a resource. There should be an extra param to find or create: ``` javascript store.find("products", "1", true); ``` When a resource...
- [ ] include a link to the waffle board - [ ] explain using "closes/fixes/connected to" in pull requests - [ ] explain release strategy w/ deprecations - [...
All CLUD actions (`create`, `load`, `update` and `destroy`) could have their events broadcast through `store.observable`. ``` javascript store.observable.filter(x => x.type === "loaded").subscribe(x => console.log(x)); store.load("products", "1"); ``` There might need...
The needs to be support for read-only attributes: ``` javascript var store = new Store(); store.define("products", { commentCount: Store.attr({ readOnly: true }) }); ``` Attributes that are read only are...
The store should have a `store.dispose()` method the in turn calls `dispose()` on `store._subject`. Pretty rare that you'd need to call it, but it should be there.
Any errors throw when running tests in the browser are hard to track down because the stack traces reference the compiled JS: ``` at load (http://localhost:49799/bundle.js?43c325:14905:31) at load (http://localhost:49799/bundle.js?43c325:15238:27) at...