Provides the storage and sequencing of a managed sort function. The sort function set may be a bespoke function or a DynDataSort object containing an compare, and subscribe attributes; compare is the only required attribute.

Note: You can set a compare function that also has a subscribe function attached as the subscribe attribute. If a subscribe function is provided the sort function can notify any updates that may change sort order and this triggers an index update.

This class forms the public API which is accessible from the .sort getter in the main reducer implementation.

const dynArray = new DynArrayReducer([...]);
dynArray.sort.clear();
dynArray.sort.set(...);
interface DynAdapterSort<T> {
    clear(): void;
    set(sort: DynCompareFn<T> | DynDataSort<T>): void;
}

Type Parameters

  • T

Methods

Methods

  • Clears & removes any assigned sort function and triggers an index update.

    Returns void