Created
November 25, 2016 04:53
-
-
Save akirattii/a7325bb155617959380dad54ec9dcec7 to your computer and use it in GitHub Desktop.
Create and fire custom event
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
| // fire `hoge` event. | |
| window.dispatchEvent(new Event('hoge')); | |
| window.addEventListener('hoge', function(e) { | |
| // callbacked on `hoge` event fired. | |
| console.log('"hoge" event fired.'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment