Created
September 30, 2010 15:11
-
-
Save michiel/604730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BLOCKSIZE = 500; | |
var dataset = []; // Assuming, of course, that there's something in here.. | |
var renderActions = []; | |
for (var i=0; i<dataset.length; i+= BLOCKSIZE) { | |
renderActions.push((function(offset) { | |
return function(callback) { | |
// | |
// Perform rendering here using dataset[offset] to start | |
// | |
setTimeout(callback, 1); // Release control | |
} | |
})(i)); // 'i' gets pulled into the new scope as 'offset' | |
} | |
var sequencer = new Sequencer(renderActions); | |
sequencer.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment