fix: prevent consts from triggering after leaving effect context

This commit is contained in:
Aiden McClelland
2026-03-16 20:07:59 -06:00
parent 7352602f58
commit 66a606c14e
3 changed files with 7 additions and 8 deletions

View File

@@ -83,10 +83,12 @@ export abstract class Watchable<Raw, Mapped = Raw> {
const constRetry = this.effects.constRetry
const cleanup = this.onConstRegistered(value)
gen.next().then(
() => {
(a) => {
abort.abort()
cleanup?.()
constRetry()
if (!a.done) {
constRetry()
}
},
() => {
abort.abort()