Skip to content

Instantly share code, notes, and snippets.

@brookjordan
Last active June 5, 2018 11:07
Show Gist options
  • Save brookjordan/445d7142a81c8df33416b755d2218c62 to your computer and use it in GitHub Desktop.
Save brookjordan/445d7142a81c8df33416b755d2218c62 to your computer and use it in GitHub Desktop.
Pause an async environment until released
let okgo = new Promise(res=>{ window.cont = () => { res(); } });
await okgo;
{
"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