Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "sources/from-event"

Index

Functions

Functions

fromEvent

  • fromEvent<K, T>(el: K, name: string, options?: boolean | AddEventListenerOptions): Observable<T>
  • Creates an observable from an EventTarget. Each event is turned into an item for the observable.

    Type parameters

    • K: EventTarget

      Type of the event target el.

    • T: Event

      Type of the events to be emitted, such as MouseEvent.

    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 Observable<T>

    New observable that emits values from the event target.

Generated using TypeDoc