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
11 lines (9 loc) • 354 B
text/typescript
import { frozen, isFrozenSnapshot } from "../frozen/Frozen"
import { registerSnapshotter } from "./fromSnapshot"
import { SnapshotterAndReconcilerPriority } from "./SnapshotterAndReconcilerPriority"
registerSnapshotter(SnapshotterAndReconcilerPriority.Frozen, (sn) => {
if (isFrozenSnapshot(sn)) {
return frozen(sn.data)
}
return undefined
})