SnapshotMutator typedef
SnapshotMutator =
SessionSnapshot? Function(SessionSnapshot? current)
A function that receives the current snapshot and returns the updated snapshot to persist.
- Return the mutated snapshot to save it.
- Return
nullto silently skip the update (no-op). - Throw to abort with an error (e.g. precondition failure).
The returned snapshot's snapshotId may be left empty ('') to let the
store assign a new identifier.
Implementation
typedef SnapshotMutator = SessionSnapshot? Function(SessionSnapshot? current);