Skip to content

A mixin for Backbone.sync to synchronize to session or local storage instead of a remote server.

License

Notifications You must be signed in to change notification settings

russplaysguitar/backbone-storage-sync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backbone-storage-sync

A mixin for Backbone.sync to synchronize to session or local storage instead of a remote server.

Build Status

Usage:

  1. Mix this object into a Backbone Model (or Collection) using Backbone.Model.extend(StorageSyncMixin) (or Backbone.Collection.extend(StorageSyncMixin)).
  2. Define syncStore and syncKey within the Backbone Model (or Collection): - syncStore is an object to sync to, such as window.sessionStorage. May be a string or function. - syncKey is the property of the object to sync to. May be a string or function. For Backbone Models, this will be used as the model identifier (defined by idAttribute).
  3. Utilize Backbone Sync methods as normal. fetch, save, destroy, create, and sync are all supported.

About

A mixin for Backbone.sync to synchronize to session or local storage instead of a remote server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%