Provides a reactive query interface to TrieSearch in addition to dynamic filtering / sorting of search results.

Type Parameters

  • T extends object

Hierarchy (view full)

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 AdapterIndexer.index.update with true to recalculate the index and notify all subscribers.

    Returns T[]

    The internal data.

  • get derived(): DerivedAPI<T[], number, T>
  • Returns DerivedAPI<T[], number, T>

    Derived public API.

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

    Returns boolean

  • get filters(): AdapterFilters<T>
  • Returns AdapterFilters<T>

    The filters adapter.

  • get index(): IndexerAPI<number, T>
  • Returns IndexerAPI<number, T>

    Returns the Indexer public API.

  • get isDestroyed(): boolean
  • Returns boolean

    The current destroyed state of this query instance.

  • get length(): number
  • Gets the main data / items length.

    Returns number

    Main data / items length.

  • get limit(): Writable<number>
  • Returns Writable<number>

    The writable store controlling the search results limit.

  • get reversed(): boolean
  • Gets current reversed state.

    Returns boolean

    Reversed state.

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

    Parameters

    • reversed: boolean

      New reversed state.

    Returns void

  • get sort(): AdapterSort<T>
  • Returns AdapterSort<T>

    The sort adapter.

Methods

  • Destroys and disconnects this query from the local stores and any associated TrieSearch instance.

    Returns void

  • Protected

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

    Returns void

  • Removes internal data and pushes new data. This does not destroy any initial array set to internal data unless replace is set to true.

    Parameters

    • data: Iterable<T> | T[]

      New data to set to internal data.

    • Optional replace: boolean

    Returns void

  • Add a subscriber to this DynArrayReducer instance.

    Parameters

    • handler: ((value) => void)

      Callback function that is invoked on update / changes. Receives this reference.

    Returns (() => void)

    Unsubscribe function.

      • (): void
      • Returns void