json-api-store
json-api-store copied to clipboard
Broadcast CLUD actions through the central observable.
All CLUD actions (create
, load
, update
and destroy
) could have their events broadcast through store.observable
.
store.observable.filter(x => x.type === "loaded").subscribe(x => console.log(x));
store.load("products", "1");
There might need to be before and after events:
store.observable.filter(x => x.type === "loadStarted").subscribe(x => console.log(x));
store.observable.filter(x => x.type === "loadCompleted").subscribe(x => console.log(x));
store.load("products", "1");