Created
May 7, 2015 15:28
-
-
Save ptasker/9846d0e1d5c19142b6e9 to your computer and use it in GitHub Desktop.
NodeJS extra arg
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
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