Created
April 14, 2019 20:59
-
-
Save mischah/dd05a2b2be4aabee0b05da37fb94d403 to your computer and use it in GitHub Desktop.
Revisions
-
mischah created this gist
Apr 14, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // Promisified setTimeout const delay = (duration = 0) => new Promise(resolve => setTimeout(() => { resolve(); }, duration) ); // Usage async function myFunction() { console.log('Do something'); await delay(); console.log('Do something else'); }