SHARE
TWEET

Untitled

a guest Jul 17th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top