aa-coordination
Rich Harris 7 months ago
parent 5969b0919c
commit d155191556

@ -140,7 +140,7 @@ export function async_derived(fn) {
// TODO we should probably null out active effect here,
// rather than inside `restore()`
}
});
}, EFFECT_HAS_DERIVED);
return Promise.resolve(promise).then(() => value);
}

@ -997,18 +997,14 @@ export function get(signal) {
} else {
// we're adding a dependency outside the init/update cycle
// (i.e. after an `await`)
// TODO we probably want to disable this for user effects,
// otherwise it's a breaking change, albeit a desirable one?
if (deps === null) {
deps = [signal];
} else if (!deps.includes(signal)) {
deps.push(signal);
}
(active_reaction.deps ??= []).push(signal);
var reactions = signal.reactions;
if (signal.reactions === null) {
if (reactions === null) {
signal.reactions = [active_reaction];
} else if (!signal.reactions.includes(active_reaction)) {
signal.reactions.push(active_reaction);
} else if (!reactions.includes(active_reaction)) {
reactions.push(active_reaction);
}
}
} else if (

Loading…
Cancel
Save