Newer version available
You’re viewing the API reference for version 3.0.3, but the latest version is 3.1.0. The latest version include may important updates and fixes.
View Latest Versionfunction once
thefrontside/effectionfunction once<T extends EventTarget, K extends EventList<T> | (string & {})>(target: T, name: K): Operation<EventTypeFromEventTarget<T, K>>
Create an 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
Operation<EventTypeFromEventTarget<T, K>>
an Operation that yields the next emitted event