Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment