• Creates a Function that toggles properties of a Sort.

    Example

    const mySort = sort([['a', 'asc'], ['b', 'asc']]);
    const toggleDirection = toggle(defaultSortDirectionCycler);
    const toggleDirection('a')(mySort);
    console.log(mySort); // Map([['b', 'asc'], ['a', 'desc']])

    Todo

    Figure out if appending is the preferred action for multi sort

    Returns

    the toggle Function

    Parameters

    Returns (<T>(property: T, clear?: boolean) => ((sort: Sort<T>, direction?: undefined | SortDirection) => void))

      • <T>(property: T, clear?: boolean): ((sort: Sort<T>, direction?: undefined | SortDirection) => void)
      • Type Parameters

        • T extends string

        Parameters

        • property: T
        • Optional clear: boolean

        Returns ((sort: Sort<T>, direction?: undefined | SortDirection) => void)

Generated using TypeDoc