Class representing a RouteManager.

Type Parameters

  • T extends Record<string, any> = Record<string, any>

    Type for the route parameters.

  • I extends ISwitchItem = ISwitchItem

    Type for the route items.

Hierarchy (View Summary)

Observables

operator: <T = any>(
    callbackfn: (value: TObserver<void>) => TObserver<T>,
) => TObserver<T>

Applies a callback function to the values emitted by an observer.

Type declaration

    • <T = any>(callbackfn: (value: TObserver<void>) => TObserver<T>): TObserver<T>
    • Type Parameters

      • T = any

        The type of values emitted by the observer.

      Parameters

      • callbackfn: (value: TObserver<void>) => TObserver<T>

        The callback function to apply to the emitted values.

      Returns TObserver<T>

      • An observer with the applied operator.

Other

debounce: (delay?: number) => TObserver<void>

Creates a debounced observer with an optional delay.

Type declaration

    • (delay?: number): TObserver<void>
    • Parameters

      • Optionaldelay: number

        The delay in milliseconds before emitting the data.

      Returns TObserver<void>

      • The debounced observer.
delay: (delay?: number) => TObserver<void>

Creates a delayed observer with an optional delay.

Type declaration

    • (delay?: number): TObserver<void>
    • Parameters

      • Optionaldelay: number

        The delay in milliseconds before emitting the data.

      Returns TObserver<void>

      • The delayed observer.
dispose: () => void

Disposes of the current object by unsubscribing from any subscriptions.

Type declaration

    • (): void
    • Returns void

Object

dispose

filter: (callbackfn: (value: void) => boolean) => TObserver<void>

Applies a filtering function to the observer and returns a new observer with filtered values.

Type declaration

    • (callbackfn: (value: void) => boolean): TObserver<void>
    • Parameters

      • callbackfn: (value: void) => boolean

        A function that tests each value in the observer. Should return true or false.

      Returns TObserver<void>

      • A new observer with filtered values.
flatMap: <T = any>(callbackfn: (value: void) => T[]) => TObserver<T>

Applies a transformation function to each value emitted by the observer and flattens the result into a single observer.

Type declaration

    • <T = any>(callbackfn: (value: void) => T[]): TObserver<T>
    • Type Parameters

      • T = any

        The type of values emitted by the observer.

      Parameters

      • callbackfn: (value: void) => T[]

        The transformation function to apply to each value emitted by the observer.

      Returns TObserver<T>

      • The observer that emits the flattened values.
  • get item(): null | I

    Retrieves the value of the item.

    Returns null | I

    The value of the item. Returns null if item is not set.

map: <T = any>(callbackfn: (value: void) => T) => TObserver<T>

Maps the values of the observer using the given callback function.

Type declaration

    • <T = any>(callbackfn: (value: void) => T): TObserver<T>
    • Type Parameters

      • T = any

        The type of the mapped values.

      Parameters

      • callbackfn: (value: void) => T

        A function that maps each value of the observer.

      Returns TObserver<T>

      • An observer with the mapped values.
mapAsync: <T = any>(
    callbackfn: (value: void) => Promise<T>,
    fallbackfn?: (e: Error) => void,
) => TObserver<T>

Asynchronously maps the emitted values of the observer using the provided callback function.

Type declaration

    • <T = any>(
          callbackfn: (value: void) => Promise<T>,
          fallbackfn?: (e: Error) => void,
      ): TObserver<T>
    • Type Parameters

      • T = any

        The type of the mapped values.

      Parameters

      • callbackfn: (value: void) => Promise<T>

        The callback function that maps the emitted values of the observer.

      • Optionalfallbackfn: (e: Error) => void

        The optional fallback function that handles errors during mapping.

      Returns TObserver<T>

      • Returns a new observer that emits the mapped values.
merge: <T = any>(observer: TObserver<T>) => TObserver<void | T>

Merges the provided observer with the current observer instance. Returns a new observer that emits values from both observers.

Type declaration

    • <T = any>(observer: TObserver<T>): TObserver<void | T>
    • Type Parameters

      • T = any

      Parameters

      • observer: TObserver<T>

        The observer to merge with the current observer.

      Returns TObserver<void | T>

      • A new observer that emits values from both observers.
  • Calls the next method to emit the specified data using the SUBJECT_EVENT event.

    Parameters

    • data: void

      The data to be emitted.

    Returns Promise<void>

    • Resolves when the emission is complete.
once: (callback: Function) => () => void

Executes the provided callback function only once. The callback function will be invoked when the specified event occurs for the first time.

Type declaration

    • (callback: Function): () => void
    • Parameters

      • callback: Function

        The function to be executed only once.

      Returns () => void

      • A function that removes the registered event listener.
  • get params(): null | T

    Returns the value of the params property.

    Returns null | T

    The value of the params property, which can be of type T or null.

reduce: <T = any>(
    callbackfn: (acm: T, cur: void) => T,
    begin: T,
) => TObserver<T>

Applies a reducer function to each value emitted by the observer and returns a single accumulated value.

Type declaration

    • <T = any>(callbackfn: (acm: T, cur: void) => T, begin: T): TObserver<T>
    • Type Parameters

      • T = any

        The type of the accumulated value and emitted values

      Parameters

      • callbackfn: (acm: T, cur: void) => T

        A function that accepts the accumulated value and the current emitted value, and returns the new accumulated value

      • begin: T

        The initial value for the accumulator

      Returns TObserver<T>

      • An observer that emits the accumulated value when the original observer completes
repeat: (interval?: number) => TObserver<void>

Creates an observer that repeats emitting values at a specified interval.

Type declaration

    • (interval?: number): TObserver<void>
    • Parameters

      • Optionalinterval: number

        The time interval at which to repeat emitting values.

      Returns TObserver<void>

      • The created observer.
split: () => Observer<readonly void[]>

Splits the observed data into batches of arrays.

Type declaration

    • (): Observer<readonly void[]>
    • Returns Observer<readonly void[]>

      • The observer that emits batches of arrays.
subscribe: (callback: Function) => () => void

Subscribes to an event.

Type declaration

    • (callback: Function): () => void
    • Parameters

      • callback: Function

        The callback function to be invoked when the event is triggered.

      Returns () => void

      • A function to unsubscribe from the event.
tap: (callbackfn: (value: void) => void) => TObserver<void>

The tap function allows you to perform side effects without modifying the observed data.

toIteratorContext: () => {
    done(): void;
    iterate(): AsyncGenerator<void, void, unknown>;
}

Converts the current object to an iterator context.

Type declaration

    • (): { done(): void; iterate(): AsyncGenerator<void, void, unknown> }
    • Returns { done(): void; iterate(): AsyncGenerator<void, void, unknown> }

      The iterator context representing the current object.

toPromise: () => Promise<void>

Converts an observer-based asynchronous operation into a promise-based asynchronous operation.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

      A promise representing the completion or failure of the asynchronous operation.

toPromise

unsubscribeAll: () => void

Unsubscribes all event listeners.

Type declaration

    • (): void
    • Returns void

      • No return value.

unsubscribeAll