No description, website, or topics provided.
CoffeeScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
compile.sh
package.json
unanimity.coffee
unanimity.js

README.md

unanimity

A nano sync for Backbone.js.

installation

npm install unanimity

usage

var nano = require('nano')('http://localhost:5984/')
  , backbone = require('backbone')
  , unanimity = require('unanimity')
  ;

var db = nano.use('test');

// bind the database to backbone
unanimity(backbone, db);

// Model id is the document id
var user = new backbone.Model(id: 'user:john.doe');

// Fetch data
user.fetch({
  success: function(){
    console.log(user.toJSON());
  }
});

Syntax is fully compatible with original Backbone.js save/fetch.