Last active
June 5, 2018 11:07
-
-
Save brookjordan/445d7142a81c8df33416b755d2218c62 to your computer and use it in GitHub Desktop.
Pause an async environment until released
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
let okgo = new Promise(res=>{ window.cont = () => { res(); } }); | |
await okgo; |
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
{ | |
"Pause async": { | |
"prefix": "pause", | |
"body": [ | |
"let pauseAsync = new Promise((res) => { window.${1:okgo} = () => { res(); } });", | |
"await pauseAsync;" | |
], | |
"description": "Pause in an async environment. Use window.okgo() to resume." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment