Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / addListener

Function: addListener() ​

addListener<T>(target, event, options?): Atom<T>

Defined in: projects/libraries/streamix/src/lib/factories/addListener.ts:13

Creates an atom that emits events of the specified type from the given EventTarget.

Type Parameters ​

T ​

T extends Event = Event

The type of the event to emit.

Parameters ​

target ​

EventTarget

The event target to listen to.

event ​

string

The name of the event to listen for.

options? ​

boolean | AddEventListenerOptions

Optional event listener options.

Returns ​

Atom<T>

An atom that emits the event objects as they occur.

Released under the MIT License.