Created
April 30, 2020 18:11
-
-
Save leonidkuznetsov18/b40c6361978d1ac96ee3d2b995623c72 to your computer and use it in GitHub Desktop.
delay promise
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
| const delayPromise = (delay) => { | |
| return function(data) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve(data); | |
| }, delay); | |
| }); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment