new Adapter()
subscribe(obj, property, fn)
- listen for when an object property changesunsubscribe(obj, property, fn)
- unsubscribe a property change handlerunsubscribeAll(obj)
- unsubscribe all events on objectget(obj, property)
- getobj
's propertyset(obj, property)
- setobj
's propertycollectionForEach(collection, fn)
- iterate a collectioncollectionSubscribe(collection, fn)
- listen for when a collection changescollectionUnsubscribe(collection, fn)
- unlisten for collection change event
Not a fan of passing the object into the adapter. I like the idea of just creating the adapter and having it track with the model it is adapting for.
I think the array adapter (I wouldn't call it collection cause that is just longer and not javascript) could be a separate option potentially. The two adapters really are very different and I could imagine users wanting to use two different ones for those. Would that work for backbone usecase, to have two?