Wednesday 24 February 2016

What is the point of using process.nextTick() with this code given it works fine without it?

Have a look at this express.js example which demonstrates how to deal with errors http://ift.tt/1R0wJwp line#32, a route is defined as below:app.get('/next', function(req, res, next){ process.nextTick(function(){ next(new Error('oh no!')); }); }); I was wondering why did the author use process.nextTick() given the app still works without it?

Submitted February 24, 2016 at 08:40AM by segmentationfaulter

No comments:

Post a Comment