Represents a collection of static operator functions.

Constructors

Properties

count: (<T>() => ((target: TObserver<T>) => TObserver<ICounted<T>>)) = count

Type declaration

    • <T>(): ((target: TObserver<T>) => TObserver<ICounted<T>>)
    • Counts the occurrences of each value emitted by the target observer.

      Type Parameters

      • T = any

        The type of values emitted by the target observer.

      Returns ((target: TObserver<T>) => TObserver<ICounted<T>>)

      • An observer that emits ICounted objects containing the value and count.
        • (target): TObserver<ICounted<T>>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<ICounted<T>>

distinct: (<T, V>(getCompareValue?: ((value: T) => V)) => ((target: TObserver<T>) => TObserver<T>)) = distinct

Type declaration

    • <T, V>(getCompareValue?): ((target: TObserver<T>) => TObserver<T>)
    • Filters out duplicate values in an observable stream based on a specified compare value.

      Type Parameters

      • T = any

        The type of the values in the observable stream.

      • V = any

        The type of the compare value.

      Parameters

      • getCompareValue: ((value: T) => V) = ...

        A function that takes a value of type T and returns its compare value of type V.

          • (value): V
          • Parameters

            • value: T

            Returns V

      Returns ((target: TObserver<T>) => TObserver<T>)

      • An observable stream with distinct values.
        • (target): TObserver<T>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<T>

group: (<T>(by: number) => ((target: TObserver<T>) => TObserver<T[]>)) = group

Type declaration

    • <T>(by): ((target: TObserver<T>) => TObserver<T[]>)
    • Groups the elements of an array in chunks of a specified size.

      Type Parameters

      • T = any

        The type of the elements in the array, or 'any' if not specified

      Parameters

      • by: number

        The size of each group

      Returns ((target: TObserver<T>) => TObserver<T[]>)

      • A function that takes an array and returns a new array with the elements grouped by the specified size
        • (target): TObserver<T[]>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<T[]>

liveness: (<T>(fallbackfn: (() => void), waitFor?: number) => ((target: TObserver<T>) => TObserver<T>)) = liveness

Type declaration

    • <T>(fallbackfn, waitFor?): ((target: TObserver<T>) => TObserver<T>)
    • Adds liveness functionality to a given observer stream.

      Type Parameters

      • T = any

        The type of values in the observer stream.

      Parameters

      • fallbackfn: (() => void)

        The fallback function to be called when liveness times out.

          • (): void
          • Returns void

      • waitFor: number = 5_000

        The time period in milliseconds to wait for liveness before calling the fallback function. Default is 5000 milliseconds.

      Returns ((target: TObserver<T>) => TObserver<T>)

      • The modified observer stream with liveness functionality.
        • (target): TObserver<T>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<T>

pair: (<T>(by??: number) => ((target: TObserver<T>) => TObserver<[T, T]>)) = pair

Type declaration

    • <T>(by?): ((target: TObserver<T>) => TObserver<[T, T]>)
    • Applies a pairwise transformation to an observer.

      Type Parameters

      • T = any

        The type of value observed by the original observer.

      Parameters

      • Optionalby: number = 2

        The number of values in each pair.

      Returns ((target: TObserver<T>) => TObserver<[T, T]>)

      • A function that takes an observer and returns a new observer that emits pairs of values.
        • (target): TObserver<[T, T]>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<[T, T]>

skip: (<T>(the: number) => ((target: TObserver<T>) => TObserver<T>)) = skip

Type declaration

    • <T>(the): ((target: TObserver<T>) => TObserver<T>)
    • Skips the first n elements emitted by an observer.

      Type Parameters

      • T = any

      Parameters

      • the: number

        The number of elements to skip.

      Returns ((target: TObserver<T>) => TObserver<T>)

      A new observer that skips the first n elements of the original observer.

        • (target): TObserver<T>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<T>

      T - The type of elements emitted by the observer.

strideTricks: (<T>(strideSize: number, step??: number) => ((target: TObserver<T[]>) => TObserver<T[][]>)) = strideTricks

Type declaration

    • <T>(strideSize, step?): ((target: TObserver<T[]>) => TObserver<T[][]>)
    • Applies stride tricks to a given target observer.

      Type Parameters

      • T = any

        The type of elements in the target observer.

      Parameters

      • strideSize: number

        The size of each stride.

      • Optionalstep: number = ...

        The step size between each stride.

      Returns ((target: TObserver<T[]>) => TObserver<T[][]>)

      The transformed observer that emits strided data.

        • (target): TObserver<T[][]>
        • Parameters

          • target: TObserver<T[]>

          Returns TObserver<T[][]>

      If the strideSize or step is too big, or if the data is unshaped.

take: (<T>(count: number) => ((target: TObserver<T>) => TObserver<T>)) = take

Type declaration

    • <T>(count): ((target: TObserver<T>) => TObserver<T>)
    • Takes a count number as an input and returns a higher-order function that accepts a target TObserver. The higher-order function returns a TObserver that filters the values emitted by the target TObserver based on the count. Only values with an index less than or equal to the count will be emitted.

      Type Parameters

      • T = any

      Parameters

      • count: number

        The maximum index of values to be emitted.

      Returns ((target: TObserver<T>) => TObserver<T>)

      A higher-order function that accepts a target TObserver and returns a TObserver that filters values based on the count.

        • (target): TObserver<T>
        • Parameters

          • target: TObserver<T>

          Returns TObserver<T>

      T - The type of values emitted by the target TObserver.