Created
September 10, 2016 17:19
-
-
Save tuxsudo/8fed0bb17f2c3ea36807295a7152e3d3 to your computer and use it in GitHub Desktop.
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
export const pauseAndPass = (time) => (data) => new Promise( (resolve) => { | |
setTimeout( () => resolve(data) , time) | |
}); | |
export default pauseAndPass; |
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
import pause from './pause-and-pass'; | |
import someAsyncThing from './some-thing' | |
someAsyncThing() | |
.then( pause(3000) ) | |
.then( (data) => console.log(data)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment