1.1.2 • Published 6 years ago

@cuties/event v1.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

cutie-event

NPM Version Build Status codecov

Cutie extension for event module in Node. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/event

Run test

npm test

Run build

npm run build

Usage

const {
  // Needed async objects here from the table below
} = require('@cuties/event');

For more information about parameters in the async objects visit docs of Node for event module.

Async ObjectAsync/sync callParameters(default value/description)Representation result
EmittedEmitteremitter.emitemitter, eventName, ...argsemitter
EmitterWithAdditionalListeneremitter.addListeneremitter, eventName, listeneremitter
EmitterWithAdditionalOneTimeListeneremitter.onceemitter, eventName, listeneremitter
EmitterWithAdditionalPrependedListeneremitter.prependListeneremitter, eventName, listeneremitter
EmitterWithAdditionalPrependedOneTimeListeneremitter.prependOnceListeneremitter, eventName, listeneremitter
EmitterWithMaxListenersemitter.setMaxListenersemitter, nemitter
EmitterWithNewListenerEventemitter.once('newListener', listener)emitter, listener(Event with definedBody(event, listener))emitter
EmitterWithRemoveEventemitter.once('removeListener', listener)emitter, listener(Event with definedBody(event, listener))emitter
EmitterWithRemovedListeneremitter.removeListeneremitter, eventName, listeneremitter
EmitterWithoutAnyListenersemitter.removeAllListenersemitter, eventNameemitter
EventNamesemitter.eventNamesemitter(string or symbol)[]
ListenerCountemitter.listenerCountemitter, eventNamenumber
Listenersemitter.listenersemitter, eventNamefunction[]
MaxListenersemitter.getMaxListenersemitternumber