Skip to content

Instantly share code, notes, and snippets.

@ptasker
Created May 7, 2015 15:28
Show Gist options
  • Save ptasker/9846d0e1d5c19142b6e9 to your computer and use it in GitHub Desktop.
Save ptasker/9846d0e1d5c19142b6e9 to your computer and use it in GitHub Desktop.
NodeJS extra arg
doTwitterCall: function (extraArg, err, result) {
//MOAR code here etc.
//extraArg is available here with a value of 'foo'
//return result
},
getResults: function (err, result) {
this.job_id = this.req.params.jobid;
var that = this;
that.result = result;
var extraArg = "foo";
this.model2.findOne(
{
'user': this.req.user,
'job_id': job_id,
'social_network_id': 2
})
//
.sort({date: 'asc'})
.exec(this.doTwitterCall.bind(this,extraArg));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment