|
|
|
@ -424,24 +424,24 @@ export function update_reaction(reaction) {
|
|
|
|
reaction.deps = deps = new_deps;
|
|
|
|
reaction.deps = deps = new_deps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (i = skipped_deps; i < deps.length; i++) {
|
|
|
|
if (!skip_reaction) {
|
|
|
|
var dep = deps[i];
|
|
|
|
for (i = skipped_deps; i < deps.length; i++) {
|
|
|
|
if (!skip_reaction) {
|
|
|
|
(deps[i].reactions ??= []).push(reaction);
|
|
|
|
(dep.reactions ??= []).push(reaction);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Reset read version back to 0. If we are
|
|
|
|
|
|
|
|
// returning to an previous reaction and
|
|
|
|
|
|
|
|
// it were to read this depedency too and we
|
|
|
|
|
|
|
|
// didn't reset the read version, then it would
|
|
|
|
|
|
|
|
// not be added as a dependency to that reaction
|
|
|
|
|
|
|
|
// as the global read version won't have changed
|
|
|
|
|
|
|
|
dep.rv = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (deps !== null && skipped_deps < deps.length) {
|
|
|
|
} else if (deps !== null && skipped_deps < deps.length) {
|
|
|
|
remove_reactions(reaction, skipped_deps);
|
|
|
|
remove_reactions(reaction, skipped_deps);
|
|
|
|
deps.length = skipped_deps;
|
|
|
|
deps.length = skipped_deps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If we are returning to an previous reaction then
|
|
|
|
|
|
|
|
// we need to increment the read version to ensure that
|
|
|
|
|
|
|
|
// any dependencies in this reaction aren't marked with
|
|
|
|
|
|
|
|
// the same version
|
|
|
|
|
|
|
|
if (previous_reaction !== null) {
|
|
|
|
|
|
|
|
read_version++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
new_deps = previous_deps;
|
|
|
|
new_deps = previous_deps;
|
|
|
|
|