A JavaScript storing library
npm install --save vanilla-store
Store.create(String category, Array items|Object item);
Store.update(String category, Array items|Object item);
Store.get(String category, String id);
Store.remove(String category, Array items|Object item);
Store.clean(String category);
Store.restore(String category, Array items);
Store.create, Store.update, Store.remove and Store.clean all trigger
events with PubSub.
These events can be used to trigger actions based on the according events.
Calling Store.create('Test', {…}) will trigger an event Test.create;
Store.update('Test', {…}) will trigger Test.update and so on.
Just requesting data with getAll, getAllByCategory and find does not
publish events.
If you want to store nested objects with Store please make sure to use a deep
object extend function. You can do so by providing a global extend function,
include jQuery or Lodash/Underscore.
Please run npm run test. Tests are written utilizing Jasmine.
MIT - 2015-2017, Hans Christian Reinl