Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/stream_observables/sources/mod.ts>fromEvent

A collection of observables built with ReadableStreams & friends.
Latest
function fromEvent
import { fromEvent } from "https://deno.land/x/stream_observables@v1.3/sources/mod.ts";

Creates an observable from an EventTarget. Each event is turned into an item for the observable.

Type Parameters

K extends EventTarget
optional
T extends Event = Event

Parameters

el: K

Event target to create an observable from.

name: string

Name of the event to listen to, such as 'click'.

optional
options: boolean | AddEventListenerOptions

Returns

New observable that emits values from the event target.