npm.io
2.3.0 • Published 9 years ago

@gitterhq/backbone-proxy-collection

Licence
MIT
Version
2.3.0
Deps
0
Vulns
0
Weekly
0

Backbone.Collection Proxy

A simple utility to help switching out collections whilst allowing their respective views to function normally.

Examples:


//Make a new collection
var privateCollection = new Backbone.Collection();
var publicCollection  = new ProxyCollection({
  collection: privateCollection
});

Now at any point if you want to switch the collection call:


var newCollection = new Backbone.Collection();
publicCollection.switchCollection(newCollection);

This will maintain you event bindings etc. Simples.