Skip to content

Commit 5ced9be

Browse files
committed
fix: on teardown, use the last known value for the signal before the se
1 parent 49d2424 commit 5ced9be

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
set_derived_sources,
1616
check_dirtiness,
1717
untracking,
18-
old_values,
1918
is_destroying_effect
2019
} from '../runtime.js';
2120
import { equals, safe_equals } from './equality.js';
@@ -36,6 +35,7 @@ import { get_stack } from '../dev/tracing.js';
3635
import { component_context, is_runes } from '../context.js';
3736

3837
export let inspect_effects = new Set();
38+
export const old_values = new Map();
3939

4040
/**
4141
* @param {Set<any>} v

packages/svelte/src/internal/client/runtime.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
BOUNDARY_EFFECT
2626
} from './constants.js';
2727
import { flush_tasks } from './dom/task.js';
28-
import { internal_set } from './reactivity/sources.js';
28+
import { internal_set, old_values } from './reactivity/sources.js';
2929
import { destroy_derived_effects, update_derived } from './reactivity/deriveds.js';
3030
import * as e from './errors.js';
3131
import { FILENAME } from '../../constants.js';
@@ -40,8 +40,6 @@ import {
4040
} from './context.js';
4141
import { is_firefox } from './dom/operations.js';
4242

43-
export const old_values = new Map();
44-
4543
// Used for DEV time error handling
4644
/** @param {WeakSet<Error>} value */
4745
const handled_errors = new WeakSet();

0 commit comments

Comments
 (0)