Backbone.Conduit
Moving Data Through Backbone
Conduit is a Backbone plugin that improves the ability of Backbone to handle large scale data sets.
Install it with npm
or bower
:
$ bower install backbone.conduit... or ...$ npm install backbone.conduit
Option #1: Faster Model Creation
Conduit.QuickCollection
is optimized to create Backbone.Model instances faster:
var collection = ; // If you have a large amount of data injected onto the page, instead of 'reset(...)' do ...var aBigArray = {} {} {} ; // let's assume this was 100K objectscollection; // Or, if you need to get it asynchronously, instead of 'fetch()' do ...collection;
Performance varies, but typically loading data into a Conduit.QuickCollection
is ~ 40% faster than a Backbone.Collection
.
Option #2: Async Data Management + Deferred Model Creation
Conduit.SparseCollection
drastically changes how data is managed in a Collection. Raw data is managed in a web worker,
and model creation only happens when data is prepared for use in a View. Sort, Filter, Map and Reduce, and other
methods are asynchronous, using Promises to manage the flow:
var MyCollection = BackboneConduitSparseCollection; BackboneConduit;
Since model creation happens at the last possible moment, and the worker thread handles the data management,
a SparseCollection
can handle hundreds of thousands of items easily.
Interesting. Can you tell me more?
- Sure! Here's The Documentation.
Reading bores me. Can you show me instead?
- Yes! Check out the Demo.
I Think It's Broken.
- Oh No! Please File An Issue.
I Have A Question
Great! Either ...
- Send a note via Gitter
- Send a note via Twitter