Interface WithOrderedMethods<T>

interface WithOrderedMethods<T> {
    thenBy(keySelector): OrderedSequence<T>;
    thenBy<TKey>(keySelector, comparer): OrderedSequence<T>;
    thenByDescending(keySelector): OrderedSequence<T>;
    thenByDescending<TKey>(keySelector, comparer): OrderedSequence<T>;
}

Type Parameters

  • T

Methods

  • Order the sequence by another key, ascending.

    // Sort by length of the string, then alphabetical order
    from(['two', 'one', 'thirteen', 'five']).orderBy(x => x.length).thenBy(x => x)
    // => ['one', 'two', 'five', 'thirteen']

    Parameters

    • keySelector: ((arg) => string | number)
        • (arg): string | number
        • Parameters

          • arg: T

          Returns string | number

    Returns OrderedSequence<T>

  • Order the sequence by another key, ascending, with a custom comparer.

    See orderBy for an example.

    Type Parameters

    • TKey

    Parameters

    Returns OrderedSequence<T>

  • Order the sequence by another key, descending.

    // Sort by length of the string, then reverse alphabetical order
    from(['one', 'two', 'thirteen', 'five']).orderBy(x => x.length).thenByDescending(x => x)
    // => ['two', 'one', 'five', 'thirteen']

    Parameters

    • keySelector: ((arg) => string | number)
        • (arg): string | number
        • Parameters

          • arg: T

          Returns string | number

    Returns OrderedSequence<T>

  • Order the sequence by another key, descending, with a custom comparer.

    See orderBy for an example.

    Type Parameters

    • TKey

    Parameters

    Returns OrderedSequence<T>

Generated using TypeDoc