pull/18062/merge
Rich Harris 4 months ago
parent 7cd62ff67d
commit 4d1436bb79

@ -266,7 +266,7 @@ export class Batch {
}
#process() {
console.group('process', this.id);
// console.group('process', this.id);
current_batch = this;
@ -332,7 +332,7 @@ export class Batch {
legacy_updates = null;
if (this.#is_deferred() || this.#is_blocked()) {
console.log(this.#is_deferred() ? 'deferred' : 'blocked');
// console.log(this.#is_deferred() ? 'deferred' : 'blocked');
this.#defer_effects(render_effects);
this.#defer_effects(effects);
@ -340,7 +340,7 @@ export class Batch {
reset_branch(e, t);
}
} else {
console.log('resolved');
// console.log('resolved');
if (this.#pending.size === 0) {
batches.delete(this);
}
@ -389,7 +389,7 @@ export class Batch {
this.#commit();
}
console.groupEnd();
// console.groupEnd();
}
/**
@ -773,28 +773,28 @@ export class Batch {
}
}
console.group('batch_values');
for (const [value, v] of batch_values) {
console.log(this.current.has(value), value.label, v);
}
console.groupEnd();
console.group('batch_cvs');
for (const [reaction, cv] of batch_cvs) {
console.log(
this.cvs.has(reaction),
cv,
reaction.deps?.map((d) => d.label),
reaction.label ?? reaction.fn
);
}
console.groupEnd();
console.group('batch_wvs');
for (const [value, wv] of batch_wvs) {
console.log(this.wvs.has(value), wv, value.label);
}
console.groupEnd();
// console.group('batch_values');
// for (const [value, v] of batch_values) {
// console.log(this.current.has(value), value.label, v);
// }
// console.groupEnd();
// console.group('batch_cvs');
// for (const [reaction, cv] of batch_cvs) {
// console.log(
// this.cvs.has(reaction),
// cv,
// reaction.deps?.map((d) => d.label),
// reaction.label ?? reaction.fn
// );
// }
// console.groupEnd();
// console.group('batch_wvs');
// for (const [value, wv] of batch_wvs) {
// console.log(this.wvs.has(value), wv, value.label);
// }
// console.groupEnd();
}
/**

@ -645,11 +645,8 @@ export function get(signal) {
var value = derived.v;
// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute
// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)
if (
((derived.f & CLEAN) === 0 && derived.reactions !== null) ||
depends_on_old_values(derived)
) {
// (a derived can be dirty due to the effect destroy removing its last reaction)
if ((is_dirty(derived) && derived.reactions !== null) || depends_on_old_values(derived)) {
value = execute_derived(derived);
}

Loading…
Cancel
Save