pull/16150/head
Matei-Paul Trandafir 3 months ago
parent 373ca3faef
commit a5c671094f
No known key found for this signature in database
GPG Key ID: BC96CA77836E14F8

@ -21,7 +21,6 @@ export const INSPECT_EFFECT = 1 << 18;
export const HEAD_EFFECT = 1 << 19;
export const EFFECT_HAS_DERIVED = 1 << 20;
export const EFFECT_IS_UPDATING = 1 << 21;
export const TEMPLATE_EFFECT = 1 << 22;
export const STATE_SYMBOL = Symbol('$state');
export const LEGACY_PROPS = Symbol('legacy props');

@ -32,8 +32,7 @@ import {
HEAD_EFFECT,
MAYBE_DIRTY,
EFFECT_HAS_DERIVED,
BOUNDARY_EFFECT,
TEMPLATE_EFFECT
BOUNDARY_EFFECT
} from '#client/constants';
import { set } from './sources.js';
import * as e from '../errors.js';
@ -345,12 +344,12 @@ export function template_effect(fn, thunks = [], d = derived) {
define_property(inner, 'name', { value: '{expression}' });
const deriveds = thunks.map(d);
block(inner, TEMPLATE_EFFECT);
block(inner);
});
}
const deriveds = thunks.map(d);
return block(() => fn(...deriveds.map(get)), TEMPLATE_EFFECT);
return block(() => fn(...deriveds.map(get)));
}
/**

@ -22,8 +22,7 @@ import {
ROOT_EFFECT,
LEGACY_DERIVED_PROP,
DISCONNECTED,
EFFECT_IS_UPDATING,
TEMPLATE_EFFECT
EFFECT_IS_UPDATING
} from './constants.js';
import { flush_tasks } from './dom/task.js';
import { internal_set, old_values } from './reactivity/sources.js';
@ -204,8 +203,8 @@ export function check_dirtiness(reaction, resuming = false) {
for (i = 0; i < length; i++) {
dependency = dependencies[i];
if (check_dirtiness(/** @type {Derived} */ (dependency))) {
/* Don't execute deriveds of template effects when unpausing, for example when outer resumes
if (check_dirtiness(/** @type {Derived} */ (dependency), resuming)) {
/* Don't execute deriveds when unpausing, for example when outer resumes
{#if outer}
{#if inner}
@ -215,7 +214,7 @@ export function check_dirtiness(reaction, resuming = false) {
inner might be undefined, so don't eagerly execute `inner.func()`
*/
if (resuming && (reaction.f & TEMPLATE_EFFECT) !== 0) return true;
if (resuming) return true;
update_derived(/** @type {Derived} */ (dependency));
}

Loading…
Cancel
Save