Created
December 28, 2018 18:49
-
-
Save jcdalton2201/fabcba789b9958d09b32e2978b684c60 to your computer and use it in GitHub Desktop.
Surma's next Event 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
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