mobx-keystone
Advanced tools
Comparing version
# Change Log | ||
## 1.11.3 | ||
- Fix: observable data will now be turned into plain data when frozen, which also fixes an issue when undoing/redoing changes to frozen objects. | ||
## 1.11.2 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "mobx-keystone", | ||
"version": "1.11.2", | ||
"version": "1.11.3", | ||
"description": "A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,1 +1,2 @@ | ||
import { isObservable, toJS } from "mobx" | ||
import { getGlobalConfig } from "../globalConfig" | ||
@@ -43,2 +44,6 @@ import type { SnapshotInOfFrozen } from "../snapshot" | ||
constructor(dataToFreeze: T, checkMode: FrozenCheckMode = FrozenCheckMode.DevModeOnly) { | ||
if (isObservable(dataToFreeze)) { | ||
dataToFreeze = toJS(dataToFreeze) | ||
} | ||
const check = | ||
@@ -45,0 +50,0 @@ checkMode === FrozenCheckMode.On || (inDevMode && checkMode === FrozenCheckMode.DevModeOnly) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
4438741
058454
0.02%