You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submit issues, pull requests, etc. if something is up! <3
Usage
This library lets you override the sync() method on your collections and
models so they're saved to localForage instead of a REST server. Simply
override your objects' sync() method with the namespace for your model:
Now whenever you save your collections or models, they'll be saved with
localForage!
Warning
This library is only about overriding Backbone.sync, which means that calling collection.remove(model) won't update the offline storage.
The Backbone.Collection.remove function is only about removing a model from a collection, to clean up all references and event listeners, but does not involve a sync operation.
If you want to destroy a model, you should use this code instead:
// retrieve a model by its id and destroy itcollection.get(id).destroy();// or// retrieve a model by its index in the collection and destroy itcollection.at(index).destroy();
License
This program is free software; it is distributed under an
Apache License.