mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
16 lines (14 loc) • 439 B
text/typescript
import { frozen, isFrozenSnapshot } from "../frozen/Frozen"
import { registerSnapshotter } from "./fromSnapshot"
import { SnapshotterAndReconcilerPriority } from "./SnapshotterAndReconcilerPriority"
/**
* @internal
*/
export function registerFromFrozenSnapshotter() {
registerSnapshotter(SnapshotterAndReconcilerPriority.Frozen, (sn) => {
if (isFrozenSnapshot(sn)) {
return frozen(sn.data)
}
return undefined
})
}