Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

nextTick() used 'for effect' - is this necessary, if so, why? #20

Open
mikemaccana opened this issue Mar 23, 2016 · 2 comments
Open

nextTick() used 'for effect' - is this necessary, if so, why? #20

mikemaccana opened this issue Mar 23, 2016 · 2 comments

Comments

@mikemaccana
Copy link
Contributor

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.

@danielmewes
Copy link
Member

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.

@mikemaccana
Copy link
Contributor Author

Ah that makes sense I see @al3xandru in the git blame - Alex do you know why this is needed? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants