# updateSortedOrder (@salmonui/data-grid/engine/sort)

> The updateSortedOrder function of @salmonui/data-grid/engine/sort: Incremental sort: the previous sorted order minus changed rows, with the changed rows of the new input inserted by binary search. Requires an ascending input (ties are broken by source index, which is what the stable full sort does for such an input). Null when a full sort is preferable.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-sort/updateSortedOrder

```ts
import { updateSortedOrder } from '@salmonui/data-grid/engine/sort';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine-sort (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine-sort.md).

## Reference

Kind: function

```ts
function updateSortedOrder<Row>(input: RowModelSnapshot<Row>, previousOutput: Int32Array, delta: RowDelta, keys: readonly SortKey<Row>[], locale: string): Int32Array | null;
```

Incremental sort: the previous sorted order minus changed rows, with the
changed rows of the new input inserted by binary search. Requires an
ascending input (ties are broken by source index, which is what the stable
full sort does for such an input). Null when a full sort is preferable.
