Provides the base implementation derived reducer for Maps / DynMapReducer.

Note: That you should never directly create an instance of a derived reducer, but instead use the DynMapReducerDerived.initialize callback to set up any initial state in a custom derived reducer.

T

Type Parameters

  • K
  • T
Implements

Constructors

Accessors

  • get data(): Map<K, T>
  • Returns the internal data of this instance. Be careful!

    Note: The returned map is the same map set by the main reducer. If any changes are performed to the data externally do invoke DynIndexerAPI.update with true to recalculate the index and notify all subscribers.

    Returns Map<K, T>

    The internal data.

  • get destroyed(): boolean
  • Returns whether this derived reducer is destroyed.

    Returns boolean

  • get index(): DynIndexerAPI<K, T>
  • Returns the Indexer public API.

    Returns DynIndexerAPI<K, T>

    Indexer API - is also iterable.

  • get length(): number
  • Returns number

    Main data / items length or indexed length.

  • get reversed(): boolean
  • Returns boolean

    Gets current reversed state.

  • set reversed(reversed): void
  • Sets reversed state and notifies subscribers.

    Parameters

    • reversed: boolean

      New reversed state.

    Returns void

Methods

  • Removes all derived reducers, subscriptions, and cleans up all resources.

    Returns void

  • Protected

    Provides a callback for custom derived reducers to initialize any data / custom configuration. This allows child classes to avoid implementing the constructor.

    Parameters

    • OptionaloptionsRest: {
          [key: string]: any;
      }

      Any additional custom options passed beyond DynDataOptions.

      • [key: string]: any

    Returns void

  • Subscribe to this DerivedMapReducer.

    Parameters

    Returns (() => void)

    Unsubscribe function.

      • (): void
      • Returns void