Created
July 6, 2019 12:41
-
-
Save chris001177/7c59655cae6ecb6bd9a457cf23d19ef3 to your computer and use it in GitHub Desktop.
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
// Import the EventBus we just created. | |
import { EventBus } from './event-bus.js'; | |
// The event handler function. | |
const clickHandler = function(clickCount) { | |
console.log(`Oh, that's nice. It's gotten ${clickCount} clicks! :)`) | |
} | |
// Listen to the event. | |
EventBus.$on('i-got-clicked', clickHandler); | |
// Stop listening. | |
EventBus.$off('i-got-clicked', clickHandler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment