A localStorage and sessionStorage adapter for Backbone.js
Switch branches/tags
Clone or download
Pull request Compare This branch is 64 commits ahead, 69 commits behind jeromegn:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
test
.documentup.json
.eslintrc.json
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
Makefile
README.md
karma.conf.js
package-lock.json
package.json
webpack.config.js

README.md

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