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

    Function addSort

    • Adds a sort to a list, replacing any existing sort on the same field.

      Type Parameters

      • TItem = any

      Parameters

      • sort: Sort<TItem>

        Sort to add.

      • existingSorts: List<Sort<TItem>>

        Current sorts, left untouched.

      • sortsLimit: number = 0

        Maximum number of sorts; 0 (the default) means unlimited. When the limit is reached the sort is not added, unless it replaces one on the same field.

      Returns List<Sort<TItem>>

      the new list of sorts.