Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.06 KB

README.md

File metadata and controls

28 lines (18 loc) · 1.06 KB

Backbone IndexedDB, localStorage and sessionStorage adapter

An, IndexedDB, localStorage and sessionStorage adapter for Backbone.

It's a drop-in replacement for Backbone.sync() to handle saving to the browser's local storage.

XMPP Chat Build Status

Usage

Create your collections like so:

const SomeCollection = Backbone.Collection.extend({

    // The first parameter is the storage name, the second parameter is the
    // storage type.
    // Possible values are: session, local and indexed
    browserStorage: new Backbone.BrowserStorage.session("SomeCollection", "session"),
    
    // ... everything else is normal.
});

Acknowledgments

This package started as a fork of jeromegn's Backbone.localStorage