npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

moped-sync-store-base

0.0.4

@forbeslindesay

npmHomeRepoSnykSocket
Downloads:131
$ npm install moped-sync-store-base
DailyWeeklyMonthlyYearly

moped-sync-store-base

Base class for moped-sync-stores

Dependency Status NPM version

Installation

npm install moped-sync-store-base

Usage

var BaseStore = require('moped-sync-store-base');

function MyStore() {
  BaseStore.call(this);
}
MyStore.prototype = Object.create(BaseStore.prototype);
MyStore.prototype.constructor = MyStore;

MyStore.prototype._getItem = function (collection, id) {
  // todo: implement me
};
MyStore.prototype._getInitial = function (filter) {
  // todo: implement me
};
MyStore.prototype._writeChanges = function (changes) {
  // todo: implement me
};
MyStore.prototype._getChanges = function (id, filter) {
  // todo: implement me
};

The base store ensures that all methods correctly return promises, and correctly handle filtering for getInitial and getChanges.

License

MIT