1.0.6 • Published 6 years ago

rx-from-event-emitter v1.0.6

Weekly downloads
1
License
Apache-2.0
Repository
gitlab
Last release
6 years ago

Description

This module extends the capabilities offered by Rx.Observable.fromEvent(), by allowing multiple kinds of events to be handled in one of the three ways a subscription allows.

Usage

Example: suppose that message is of type http.IncomingMessage; you can use several kinds of events from it and they will be treated in one of the three ways corresponding to the subscription mechanism:

  • 'data': put here the normal events, and their outputs will be given to next();
  • 'error': put here the error events, and their outputs will be given to error();
  • 'close', 'end': put here the events corresponding to complete().

The events arrays must be given in that order: next, error, complete.

So you can write: makeRxObservableFromEventEmitter<Buffer>(message, ['data'], ['error'], ['close', 'end'])

In some cases, the normal output is an Array, such as Buffer[]. In these cases, use this function: makeRxObservableFromEventEmitterArray<Buffer>(emitter, ['data'], ['error'], ['close', 'end'])

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago