Backbone DataStore
npm install backbone.datastore
Introduction
Once required, collection and model data will be cached in memory for { this.expires }'s seconds after the initial fetch. All models and collections will be cached unless the object's store property is set to false like so...
var realtimeCollection = BackboneCollection
Once the cached data has expired, the subsequent fetch request will fetch from REST endpoint and recache repeating the cycle.
CommonJS
// This is the top of my Backbone application! var Backbone = ; // Must be required prior to data store var DataStore = ;DataStore;
Disable data storage
At class level...
var realtimeCollection = BackboneCollection
At instance level...
var realtimeInstance = store: false
At fetch level...
realtimeInstance
Options
...