Options
All
  • Public
  • Public/Protected
  • All
Menu

Module observable-utils

Observable utilities like operators and all that good stuff.

Index

Functions

fromExtensionEventPattern

  • fromExtensionEventPattern<V, T>(target: Event<T>): Observable<V>
  • Create an observable which listens to events from an extension event target.

    These event targets use addListener and removeListener which take a single argument, the event listener. This makes them different from common event targets which take the event name as an argument. They also pass multiple arguments instead of only one event object.

    Arguments that would normally be passed to the event listener are wrapped in an array.

    see

    mapArrayToObject to create an object from the array.

    Type parameters

    • V: any[]

    • T: function

    Parameters

    • target: Event<T>

    Returns Observable<V>

mapArrayToObject

  • mapArrayToObject<T>(keys: Array<keyof T>): function
  • Operator to convert an array to an object. This makes sense if you have a predictable array structure.

    Keys without a value default to undefined.

    Type parameters

    • T: object

    Parameters

    • keys: Array<keyof T>

      Object keys in order of the array

    Returns function

      • (source: Observable<Array<T[keyof T]>>): Observable<T>
      • Parameters

        • source: Observable<Array<T[keyof T]>>

        Returns Observable<T>

Generated using TypeDoc