Skip to content

Commit

Permalink
refactor: should throw errors in computed getters
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 24, 2024
1 parent 9fd1284 commit 85f3592
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/reactivity/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,13 @@ export function refreshComputed(computed: ComputedRefImpl) {
}
} catch (err) {
dep.version++
throw err
} finally {
activeSub = prevSub
shouldTrack = prevShouldTrack
cleanupDeps(computed)
computed.flags &= ~EffectFlags.RUNNING
}

activeSub = prevSub
shouldTrack = prevShouldTrack
cleanupDeps(computed)
computed.flags &= ~EffectFlags.RUNNING
}

function removeSub(link: Link) {
Expand Down

0 comments on commit 85f3592

Please sign in to comment.