Skip to content

@sqlrooms/room-shell / RoomStorePersistenceSnapshotEquivalence

Type Alias: RoomStorePersistenceSnapshotEquivalence<TSnapshot>

RoomStorePersistenceSnapshotEquivalence<TSnapshot> = object

Type Parameters

Type Parameter
TSnapshot

Properties

compareSnapshots?

optional compareSnapshots?: (next, previous) => boolean

Returns true when two serialized snapshots should be treated as equivalent.

Defaults to referential equality, which preserves existing behavior for primitive string snapshots.

Parameters

ParameterType
nextTSnapshot
previousTSnapshot

Returns

boolean


getSnapshotRevision?

optional getSnapshotRevision?: (snapshot) => unknown

Extracts a stable revision from a snapshot for equivalence checks.

Ignored when compareSnapshots is provided.

Parameters

ParameterType
snapshotTSnapshot

Returns

unknown