Last active
December 14, 2016 05:52
-
-
Save jordic/c98afe24a9ab3ca2bcfe22b3682b2189 to your computer and use it in GitHub Desktop.
Fake Promise
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
function fakePromise(delay: number, val:number): Promise<number> { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log('Promise resolved', val); | |
resolve(val); | |
}, delay); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment