Skip to content

Commit

Permalink
Revert "fix(vanilla): createSnapshot (#970)"
Browse files Browse the repository at this point in the history
This reverts commit 487ded5.
  • Loading branch information
dai-shi committed Oct 30, 2024
1 parent c6f5e9e commit 44d4a28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vanilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ const createSnapshotDefault = <T extends object>(
if (refSet.has(value as object)) {
markToTrack(value as object, false) // mark not to track
} else if (proxyStateMap.has(value as object)) {
const [target] = proxyStateMap.get(value as object) as ProxyState
desc.value = createSnapshotDefault(target, version) as Snapshot<T>
const [target, ensureVersion] = proxyStateMap.get(
value as object,
) as ProxyState
desc.value = createSnapshotDefault(target, ensureVersion()) as Snapshot<T>
}
Object.defineProperty(snap, key, desc)
})
Expand Down

0 comments on commit 44d4a28

Please sign in to comment.