Created
July 6, 2021 08:48
-
-
Save schickling/237bc01b2b3d1afa3a1d206f940d73db to your computer and use it in GitHub Desktop.
Pair of promise and resolve function
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
export const createOpenPromise = () => { | |
let resolve: () => void | |
return { | |
promise: new Promise((resolve_: any) => { | |
resolve = resolve_ | |
}), | |
resolve: resolve!, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment