unanimity
v0.0.3
Published
Making backbone.js and nano seamlessly work together!
Downloads
4
Readme
unanimity
A nano
sync for Backbone.js
, sampe use:
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
user = new backbone.Model(id: 'user:jhon.doe')
// Fetch data
user.fetch({
success: function(){
console.log(user.toJSON());
}
});
Syntax is fully compatible with original Backbone.js save/fetch.