Skip to content

Commit b1d8b97

Browse files
committed
Fixed potential issue in untracked
1 parent 3d35567 commit b1d8b97

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/core/derivation.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ export function clearObserving(derivation: IDerivation) {
261261

262262
export function untracked<T>(action: () => T): T {
263263
const prev = untrackedStart()
264-
const res = action()
265-
untrackedEnd(prev)
266-
return res
264+
try {
265+
return action()
266+
} finally {
267+
untrackedEnd(prev)
268+
}
267269
}
268270

269271
export function untrackedStart(): IDerivation | null {

0 commit comments

Comments
 (0)