API reference › @evolu/common › Task › RunSnapshot
Defined in: packages/common/src/Task.ts:1026
A recursive snapshot of a Run tree.
Snapshots use structural sharing — unchanged subtrees return the same object reference. This is useful for UI libraries like React that leverage referential transparency to skip re-rendering unchanged parts. Snapshots are computed on demand rather than pushed on every change. Push would require O(depth) new snapshot objects per mutation.
See
Properties
abortMask
readonly abortMask: number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"AbortMask">;
Defined in: packages/common/src/Task.ts:1037
The abort mask depth. 0 means abortable, >= 1 means unabortable.
children
readonly children: readonly RunSnapshot[];
Defined in: packages/common/src/Task.ts:1034
Child snapshots in run order.
id
readonly id: string & Brand<"Id">;
Defined in: packages/common/src/Task.ts:1028
The Run.id this snapshot represents.
state
readonly state:
| Readonly<{
type: "Running";
}>
| Readonly<{
type: "Disposing";
}>
| Readonly<{
outcome: | Readonly<{
ok: true;
value: unknown;
}>
| Readonly<{
error: unknown;
ok: false;
}>;
result: | Readonly<{
ok: true;
value: unknown;
}>
| Readonly<{
error: unknown;
ok: false;
}>;
type: "Settled";
}>;
Defined in: packages/common/src/Task.ts:1031
The current lifecycle state.