1.0.2 • Published 7 years ago

@instaffogmbh/event-peddler v1.0.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
7 years ago

@instaffogmbh/event-peddler

Light-weight notification mechanism with 3rd party subscription, like unverified newsletters.

API

This module exports one function:

emit = makeEventPeddler()

Returns a function with a list of potential targets in its potentialTargets property. Call emit(evName[, ...args]) to notify all targets that have a property named 'on' + evName.

Methods on emit:

  • nPot: Returns the current number (length) of potentialTargets.
  • subscribeThese: Expects an array as argument. Adds all objects in that array to potentialTargets. Aliases: sub, meet

 

License

MIT

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago