8000 chore: rename EFFECT_HAS_DERIVED to EFFECT_PRESERVED (#16283) · sveltejs/svelte@49cba86 · GitHub
[go: up one dir, main page]

Skip to content

Commit 49cba86

Browse files
authored
chore: rename EFFECT_HAS_DERIVED to EFFECT_PRESERVED (#16283)
1 parent 32882a9 commit 49cba86

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const EFFECT_RAN = 1 << 15;
1717
export const EFFECT_TRANSPARENT = 1 << 16;
1818
export const INSPECT_EFFECT = 1 << 18;
1919
export const HEAD_EFFECT = 1 << 19;
20-
export const EFFECT_HAS_DERIVED = 1 << 20;
20+
export const EFFECT_PRESERVED = 1 << 20;
2121
export const EFFECT_IS_UPDATING = 1 << 21;
2222

2323
export const STATE_SYMBOL = Symbol('$state');

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

Lines changed: 2 additions & 2 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @import { Derived, Effect } from '#client' */
22
import { DEV } from 'esm-env';
3-
import { CLEAN, DERIVED, DIRTY, EFFECT_HAS_DERIVED, MAYBE_DIRTY, UNOWNED } from '#client/constants';
3+
import { CLEAN, DERIVED, DIRTY, EFFECT_PRESERVED, MAYBE_DIRTY, UNOWNED } from '#client/constants';
44
import {
55
active_reaction,
66
active_effect,
@@ -38,7 +38,7 @@ export function derived(fn) {
3838
} else {
3939
// Since deriveds are evaluated lazily, any effects created inside them are
4040
// created too late to ensure that the parent effect is added to the tree
41-
active_effect.f |= EFFECT_HAS_DERIVED;
41+
active_effect.f |= EFFECT_PRESERVED;
4242
}
4343

4444
/** @type {Derived<V>} */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
INSPECT_EFFECT,
3232
HEAD_EFFECT,
3333
MAYBE_DIRTY,
34-
EFFECT_HAS_DERIVED,
34+
EFFECT_PRESERVED,
3535
BOUNDARY_EFFECT,
3636
STALE_REACTION
3737
} from '#client/constants';
@@ -135,7 +135,7 @@ function create_effect(type, fn, sync, push = true) {
135135
effect.first === null &&
136136
effect.nodes_start === null &&
137137
effect.teardown === null &&
138-
(effect.f & (EFFECT_HAS_DERIVED | BOUNDARY_EFFECT)) === 0;
138+
(effect.f & (EFFECT_PRESERVED | BOUNDARY_EFFECT)) === 0;
139139

140140
if (!inert && push) {
141141
if (parent !== null) {

0 commit comments

Comments
 (0)
0