Function: getSnapshot()
Call Signature
function getSnapshot<T>(type, nodeOrPrimitive): TypeToSnapshotOut<T>;
Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends AnyType | Object type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
type | T | - |
nodeOrPrimitive | TypeToData<T> | Data structure, including primtives. |
Returns
The snapshot.
Call Signature
function getSnapshot<T>(nodeOrPrimitive): SnapshotOutOf<T>;
Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Object type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
nodeOrPrimitive | T | Data structure, including primtives. |
Returns
The snapshot.