Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // Import the EventBus we just created.
  2. import { EventBus } from './event-bus.js';
  3.  
  4. // The event handler function.
  5. const clickHandler = function(clickCount) {
  6. console.log(`Oh, that's nice. It's gotten ${clickCount} clicks! :)`)
  7. }
  8.  
  9. // Listen to the event.
  10. EventBus.$on('i-got-clicked', clickHandler);
  11.  
  12. // Stop listening.
  13. EventBus.$off('i-got-clicked', clickHandler);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement