Class EventEmitter<T>

Generalized, minimal implementation of a container that holds callbacks, and can emit values to them.

This implementation does not accept "named" events like emitter.on('error', function (err) {...}), and as a consequence is drastically more simple / compact / efficient than other event emitter implementations.

In general, rather than smashing multiple "named" events onto one emitter, just make multiple emitter instances instead.

For Example:

  • emitter.on('next', ...) -> onNext: EventEmitter;
  • emitter.on('done', ...) -> onDone: EventEmitter;
  • emitter.on('error', ...) -> onError: EventEmitter;

Type Parameters

  • T

Hierarchy

  • EventEmitter

Constructors

Accessors

Methods

  • Transform this instance into an observable stream, using the given generator function.

    This caters mainly towards the fromEventPattern creator function provided by RxJS.

    Type Parameters

    • ObservableType

    Parameters

    Returns ObservableType

Generated using TypeDoc