squashRecordDiffs

See source code

Squash a collection of diffs into a single diff.

function squashRecordDiffs<T extends UnknownRecord>(
  diffs: RecordsDiff<T>[],
  options?: {
    mutateFirstDiff?: boolean
  }
): RecordsDiff<T>

Parameters

NameDescription

diffs

An array of diffs to squash.

options

{
  mutateFirstDiff?: boolean
}

An optional object with a mutateFirstDiff property. If mutateFirstDiff is true, the first diff in the array will be mutated in-place.

Returns

A single diff that represents the squashed diffs.

Prev
reverseRecordsDiff
Next
useSync