hoodie-plugin-backbone
Backbone bindings for Hoodie
Installation
hoodie install backbone
Usage
The Backbone plugin provides a hoodie.backbone
backbone API
with two properties:
hoodie.backbone.Model
hoodie.backbone.Collection
When inheriting from the hoodie.backbone
Model or Collection,
all changes get automagically persisted using hoodie, and changes
coming from remote will be passed trough.
Example
var TodoModel = hoodiebackboneModel;var TodoCollection = hoodiebackboneCollection;var todos = ; todos;
Options
type
The type property must be set when inheriting from hoodie.backbone.model
hoodie.filter
By default, a collection automatically reflects all changes coming from remote for the type of its model. If you want it to react to only certain events, a filter function can be passed
var TodoCollection = hoodiebackboneCollection;var todos = parent: list;
If the filter function returns false, the event for the past object will be ignored.
License
MIT