0.0.8 • Published 7 years ago

rkgttr-publisher v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

rkgttr-publisher

NPM version NPM downloads Build Status Coverage Status Dependency Status

Based on event-pubsub, a custom events publisher.

How to Install

$ npm install rkgttr-publisher --save-dev

or

$ yarn add rkgttr-publisher --dev

Getting Started

Publisher static methods

  • on: will bind the handler function to the the type event. Just like addEventListener in the browser, takes 2 parameters:
    • type: a string representing the event.
    • callback: a method you want to invoke when this type of event is triggered.
  • off: will unbind the handler function from the the type event. If the handler is "*", all handlers for the event type will be removed, takes 2 parameters:
    • type: a string representing the event.
    • callback: a method you want to remove when this type of event is triggered, or * if you want to remove all event handlers for this event.
  • trigger: will call all handler functions bound to the event type and pass all ...data arguments to those handlers:
    • type: a string representing the event.
    • ...data: Arguments to send when triggering the event.

License

MIT © 2016 Erik Guittiere

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago