githubEdit

Evt.from<T>(...)

Creates an Evt that post events of a specific type coming from other API that emmits events.

Returns

Evt<T> will post every time the emitter emits

Parameters

Ctx Optional, Allows detaching the handlers attached to the source emitter.

emitter: Any of the following,

  • DOM EventTarget

  • Node.js EventEmitter

  • JQuery-like event target

  • RxJS Subject

  • An Array, NodeList or HTMLCollection of many of these.

  • A promise

Depending of the API the type argument will be inferred or not.

name: The event name of interest, being emitted by the target.

Examples

With DOM EventTarget

Run the examplearrow-up-right

Run the examplearrow-up-right

From EventEmitter

Run the examplearrow-up-right

With RxJS Subject

Run the examplearrow-up-right

With JQuery-like event target

Last updated

Was this helpful?