Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement