Provides the base implementation derived reducer for arrays / DynArrayReducer.

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

Type Parameters

  • T
Implements

Constructors

Accessors

  • get data(): T[]
  • Returns the internal data of this instance. Be careful!

    Note: if an array is set as initial data then that array is used as the internal data. If any changes are performed to the data externally do invoke DynIndexerAPI.update with true to recalculate the index and notify all subscribers.

    Returns T[]

    The internal data.

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

    Returns boolean

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

    Returns DynIndexerAPI<number, 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: boolean): 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.

    Returns void