Skip to content

Instantly share code, notes, and snippets.

@tedsuo
Created July 10, 2013 00:13
Show Gist options
  • Save tedsuo/5962457 to your computer and use it in GitHub Desktop.
Save tedsuo/5962457 to your computer and use it in GitHub Desktop.
function combinator(func,data,args){
new_args = [data].concat(args);
return function(cb){
new_args.push(cb);
func.apply(this,new_args);
}
}
function getCell(data,row_id,col_id,cb){
var cell = data.cells[row_id][col_id];
cb(null,cell)
}
op1 = combinator(getCell,data,['aasdasdasd','23rewrdfbdbf']);
op2 = combinator(setCell,data,['2353253452','sdafsdafsdaf','foo']);
op3 = combinator(getCell,data,['asdfdfsadfsafds','dsfdsffdsdfsfsd']);
async.series([
op1,
op2,
op3
],
function(err){
reRender();
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment