Effection Logo

function once

thefrontside/effection

function once<T extends EventTarget, K extends EventList<T> | (string & {})>(target: T, name: K): Operation<EventTypeFromEventTarget<T, K>>

Create an https://effection-www-7a79x8qmc0zv.deno.dev/api/v3/Operation that yields the next event to be emitted by an EventTarget.

Type Parameters

T extends EventTarget

K extends EventList<T> | string & {}

Parameters

target: T

  • the event target to be watched

name: K

  • the name of the event to watch. E.g. "click"

Return Type

https://effection-www-7a79x8qmc0zv.deno.dev/api/v3/Operation&lt;EventTypeFromEventTarget&lt;T, K>>

an Operation that yields the next emitted event