0.0.3 • Published 12 years ago

ss-backbone v0.0.3

Weekly downloads
33
License
-
Repository
-
Last release
12 years ago

SS-Backbone

Add to your app.js:

ss.responders.add(require('ss-backbone'));

Backbone models inherit from syncedModel and declare modelname on the class:

myModel = syncedModel.extend( {}, {modelname: "myModel"} );

Backbone collections inherit from syncedCollection and also declare modelname (for now):

myCollection = syncedCollection.extend( {model: myModel}, {modelname: "myModel"} )

On the server /server/models/mymodel.js

module.exports = function(ss) {
  	return {
    	create: function(msg, meta, send) {
    		#do stuff
    	},
    	update: function(msg, meta, send) {
    		#do stuff
    	},
    	read: function(msg, meta, send) {
    		#do stuff
    	},
    	delete: function(msg, meta, send) {
    		#do stuff
    	}
    }
}

Check out the (Todo example code) and live app at (http://ss-backbone-example.jit.su/)

0.0.3

12 years ago

0.0.24

12 years ago

0.0.23

12 years ago

0.0.22

12 years ago

0.0.21

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago