rethinkdb-example-nodejs-chat
rethinkdb-example-nodejs-chat copied to clipboard
nextTick() used 'for effect' - is this necessary, if so, why?
https://github.com/rethinkdb/rethinkdb-example-nodejs-chat/blob/master/app.js#L48 has
passport.use(new local(
function(username, password, done) {
// asynchronous verification, for effect...
process.nextTick(function () {
Is the nextTick()
actually necessary, or is it 'for effect'?
- If it's necessary, why is it necessary? The comment is very vague.
- If it's not necessary, should the nextTick be removed?
Thanks for taking the time to answer this - I understand what nextTick()
does, but it's not apparent why it's being used here.
It doesn't look like it's necessary for the basic functionality, but I guess that it still servers some purpose (could it be making some transition look nicer in the UI?).
If @al3xandru wants to chime in, he might remember more about this.
Ah that makes sense I see @al3xandru in the git blame - Alex do you know why this is needed? Thanks!