pull/16197/head
Rich Harris 8 months ago
parent 0bc2af265d
commit 2fbf29025e

@ -1,6 +1,7 @@
/** @import { Effect, Source } from '#client' */
import { DIRTY } from '../constants.js';
import { flush_sync } from '../runtime.js';
import { internal_set } from './sources.js';
import { internal_set, mark_reactions } from './sources.js';
/** @type {Set<Fork>} */
const forks = new Set();
@ -28,26 +29,26 @@ export class Fork {
var values = new Map();
for (const source of this.previous.keys()) {
// mark_reactions(source, DIRTY);
values.set(source, source.v);
}
for (const [source, current] of this.current) {
source.v = current;
}
for (const fork of forks) {
if (fork === this) continue;
for (const [source, previous] of fork.previous) {
if (!values.has(source)) {
// mark_reactions(source, DIRTY);
values.set(source, source.v);
// internal_set(source, previous);
source.v = previous;
}
}
}
for (const [source, current] of this.current) {
source.v = current;
// internal_set(source, current);
}
return () => {
for (const [source, value] of values) {
source.v = value;

Loading…
Cancel
Save