Skip to content

Instantly share code, notes, and snippets.

@jcdalton2201
Created December 28, 2018 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcdalton2201/fabcba789b9958d09b32e2978b684c60 to your computer and use it in GitHub Desktop.
Save jcdalton2201/fabcba789b9958d09b32e2978b684c60 to your computer and use it in GitHub Desktop.
Surma's next Event function
function nextEvent(target,name) {
return new Promise(resolve => {
target.addEventListener(name, resolve, {once:true});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment