Created
November 30, 2018 23:45
-
-
Save hyzhak/2d8c4aafdbfde18fc797cb73250a7758 to your computer and use it in GitHub Desktop.
next tick promise build which could be used when we need to wait before next portion of async calls
This file contains 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
/** | |
* Create next trick promise which could be used: | |
* | |
* lazyAction() | |
* .then(nextTick()) | |
* .then(doSomethingElse) | |
* | |
* @returns {Promise} | |
*/ | |
module.exports = () => new Promise(resolve => process.nextTick(resolve)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment