dont update derived status when time-travelling

pull/15844/head
Rich Harris 2 months ago
parent 6912cd3621
commit c419ab0eec

@ -33,7 +33,7 @@ import { tracing_mode_flag } from '../../flags/index.js';
import { Boundary } from '../dom/blocks/boundary.js'; import { Boundary } from '../dom/blocks/boundary.js';
import { component_context } from '../context.js'; import { component_context } from '../context.js';
import { UNINITIALIZED } from '../../../constants.js'; import { UNINITIALIZED } from '../../../constants.js';
import { current_batch } from './batch.js'; import { batch_deriveds, current_batch } from './batch.js';
/** @type {Effect | null} */ /** @type {Effect | null} */
export let current_async_effect = null; export let current_async_effect = null;
@ -328,8 +328,12 @@ export function update_derived(derived) {
// cleanup function, or it will cache a stale value // cleanup function, or it will cache a stale value
if (is_destroying_effect) return; if (is_destroying_effect) return;
if (batch_deriveds !== null) {
batch_deriveds.set(derived, derived.v);
} else {
var status = var status =
(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN; (skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;
set_signal_status(derived, status); set_signal_status(derived, status);
}
} }

Loading…
Cancel
Save