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

@ -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();
}
/**
@ -1122,6 +1122,10 @@ export function eager(fn) {
get(version);
if (DEV) {
version.label = '<eager>';
}
eager_effect(() => {
if (initial) {
// the first time this runs, we create an eager effect

@ -374,7 +374,9 @@ export function render_effect(fn, flags = 0) {
*/
export function template_effect(fn, sync = [], async = [], blockers = []) {
flatten(blockers, sync, async, (values) => {
create_effect(RENDER_EFFECT, () => fn(...values.map(get)));
create_effect(RENDER_EFFECT, () => {
fn(...values.map(get));
});
});
}

Loading…
Cancel
Save