@theredhead — Frontend Library - v1.0.0
    Preparing search index...
    • Compiles a SortExpression into a comparator function.

      Uses locale-aware string comparison by default. The first entry is the primary sort; subsequent entries act as tie-breakers.

      Type Parameters

      • T

        The row object type.

      Parameters

      Returns (a: T, b: T) => number

      A comparator function (a, b) => number.

      const cmp = compileSortExpression<Employee>([
      { columnKey: 'department', direction: SortDirection.Ascending },
      { columnKey: 'name', direction: SortDirection.Ascending },
      ]);
      const sorted = employees.sort(cmp);