mobx-keystone-mindreframer
Version:
A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more
12 lines (11 loc) • 480 B
TypeScript
import type { SnapshotOutOf } from "./SnapshotOf";
/**
* 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.
*
* @typeparam T Object type.
* @param nodeOrPrimitive Data structure, including primtives.
* @returns The snapshot.
*/
export declare function getSnapshot<T>(nodeOrPrimitive: T): SnapshotOutOf<T>;