Created
July 23, 2015 12:13
-
-
Save Razenbull/e1d252751f1e9719d1f6 to your computer and use it in GitHub Desktop.
Promise function to delay an action when fullfilled
This file contains hidden or 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
/** | |
* | |
* @param delay | |
* @returns {Promise} | |
*/ | |
function promiseDelay(delay) { | |
return new Promise(function(resolve) { | |
setTimeout(resolve, delay); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment