Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/Evt.from.ts>from

💧EventEmitter's typesafe replacement
Go to Latest
function from
import { from } from "https://deno.land/x/evt@v2.5.2/lib/Evt.from.ts";

Type Parameters

K extends keyof dom.HTMLElementEventMap

Parameters

ctx: CtxLike<any>
target: EventTargetLike.HTMLElement
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.HTMLElementEventMap[K]>

Type Parameters

K extends keyof dom.WindowEventMap

Parameters

ctx: CtxLike<any>
target: EventTargetLike.Window
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.WindowEventMap[K]>

Type Parameters

K extends keyof dom.DocumentEventMap

Parameters

ctx: CtxLike<any>
target: EventTargetLike.Document
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.DocumentEventMap[K]>

Parameters

ctx: CtxLike<any>
target: OneOrMany<EventTargetLike.NodeStyleEventEmitter | EventTargetLike.JQueryStyleEventEmitter>
eventName: string

Parameters

ctx: CtxLike<any>
target: OneOrMany<EventTargetLike.HasEventTargetAddRemove<T>>
eventName: string
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Parameters

ctx: CtxLike<any>
target: OneOrMany<EventTargetLike.RxJSSubject<T>>

Parameters

ctx: CtxLike<any>
target: PromiseLike<T>

Type Parameters

Target
Entry

Parameters

ctx: CtxLike<any>
ObserverConstructor: ObserverConstructor<Target, Entry>
target: Target

Type Parameters

K extends keyof dom.HTMLElementEventMap

Parameters

target: EventTargetLike.HTMLElement
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.HTMLElementEventMap[K]>

Type Parameters

K extends keyof dom.WindowEventMap

Parameters

target: EventTargetLike.Window
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.WindowEventMap[K]>

Type Parameters

K extends keyof dom.DocumentEventMap

Parameters

target: EventTargetLike.Document
eventName: K
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Returns

Evt<dom.DocumentEventMap[K]>

Parameters

target: OneOrMany<EventTargetLike.NodeStyleEventEmitter | EventTargetLike.JQueryStyleEventEmitter>
eventName: string

Parameters

target: OneOrMany<EventTargetLike.HasEventTargetAddRemove<T>>
eventName: string
optional
options: EventTargetLike.HasEventTargetAddRemove.Options

Parameters

target: OneOrMany<EventTargetLike.RxJSSubject<T>>