@mantlebee/ts-data
    Preparing search index...

    Class SingleSortExtension<TItem>

    SortExtension holding one sort at most: addSort replaces the current sort, whatever its field, raising a single addSort event.

    Type Parameters

    • TItem = Any

      Type of the items.

    Hierarchy (View Summary)

    Index
    _changeDelay: number
    _eventBus: EventBus<SortExtensionEvents<TItem>>

    Bus used to register handlers and to raise the events.

    _sorts: List<Sort<TItem>> = []
    _sortsLimit: number
    • Appends a sort, replacing the sort on the same field, if any (the replacement goes to the end, i.e. to the lowest priority). When the limit is reached and no sort is replaced, nothing changes but the events are raised anyway with the unchanged sorts.

      Parameters

      Returns void

    • Registers a handler for an event.

      Type Parameters

      • TKey extends string

        Name of the event to listen to.

      Parameters

      Returns IDisposable

      a subscription; dispose it to remove this single handler.