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 on
thefrontside/effectionfunction on<T extends EventTarget, K extends EventList<T> | (string & {})>(target: T, name: K): Stream<EventTypeFromEventTarget<T, K>, never>
Create a Stream of events from any EventTarget.
See the guide on Streams and Subscriptions for details on how to use streams.
Type Parameters
T extends EventTarget
K extends EventList<T> | string & {}
Parameters
target: T
- the event target whose events will be streamed
name: K
- the name of the event to stream. E.g. "click"
Return Type
Stream<EventTypeFromEventTarget<T, K>, never>
a stream that will see one item for each event