Skip to content

Commit 85268bc

Browse files
committed
revert
1 parent 562c9e3 commit 85268bc

File tree

1 file changed

+1
-22
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+1
-22
lines changed

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import { equals, safe_equals } from './equality.js';
1616
import * as e from '../errors.js';
1717
import { destroy_effect } from './effects.js';
18-
import { inspect_effects, old_values, set_inspect_effects } from './sources.js';
18+
import { inspect_effects, set_inspect_effects } from './sources.js';
1919
import { get_stack } from '../dev/tracing.js';
2020
import { tracing_mode_flag } from '../../flags/index.js';
2121
import { component_context } from '../context.js';
@@ -175,27 +175,6 @@ export function update_derived(derived) {
175175
var value = execute_derived(derived);
176176

177177
if (!derived.equals(value)) {
178-
// store old value before updating
179-
// so that user_effect teardown functions
180-
// can access the previous value.
181-
// this is needed because derived updates happen early during
182-
// effects dependency resolution (before cleanup),
183-
// unlike direct state/derived updates, and this
184-
// can happen also during template_effect execution
185-
// that also happens before user_effect teardown.
186-
//
187-
// store old value only if not inside a teardown function
188-
// because we only need to save the old values before
189-
// the cleanup is triggered othewise accessing
190-
// a derived during cleanup will return the incorrect
191-
// value in case the derived wasn't in the deps of the effect,
192-
// or the teardown was executed because the component was
193-
// destroyed.
194-
if (!is_destroying_effect) {
195-
var old_value = derived.v;
196-
old_values.set(derived, old_value);
197-
}
198-
199178
derived.v = value;
200179
derived.wv = increment_write_version();
201180
}

0 commit comments

Comments
 (0)