@instaffogmbh/event-peddler

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

Stats

StarsIssuesVersionUpdatedCreatedSize
@instaffogmbh/event-peddler
1.0.23 years ago3 years agoMinified + gzip package size for @instaffogmbh/event-peddler in KB

Readme



@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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.