- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 33.7k
 
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.
Description
Just a quick idea I had after talking to @sindresorhus.
When process.nextTick() is called without a function, return a Promise:
async function fn() {
  await process.nextTick();
}in effect:
function nextTick(fn) {
  if (typeof fn === 'function') {
    process.nextTick(fn);
  } else {
    return new Promise(res => process.nextTick(res));
  }
}As more of Node (possibly) moves to Promises/async-await for APIs (#15413) this makes sense I think
sindresorhus, kentcdodds, florianb, pratheekhegde, fregante and 21 more
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.