remove EFFECT_IS_UPDATING

pull/15844/head
Rich Harris 3 months ago
parent 6c2064b195
commit 179980e965

@ -18,14 +18,13 @@ export const EFFECT_TRANSPARENT = 1 << 16;
export const INSPECT_EFFECT = 1 << 17;
export const HEAD_EFFECT = 1 << 18;
export const EFFECT_PRESERVED = 1 << 19;
export const EFFECT_IS_UPDATING = 1 << 20;
export const USER_EFFECT = 1 << 21;
export const USER_EFFECT = 1 << 20;
// Flags used for async
export const REACTION_IS_UPDATING = 1 << 22;
export const EFFECT_ASYNC = 1 << 23;
export const REACTION_IS_UPDATING = 1 << 21;
export const EFFECT_ASYNC = 1 << 22;
export const ERROR_VALUE = 1 << 24;
export const ERROR_VALUE = 1 << 23;
export const STATE_SYMBOL = Symbol('$state');
export const LEGACY_PROPS = Symbol('legacy props');

@ -19,7 +19,6 @@ import {
ROOT_EFFECT,
DISCONNECTED,
REACTION_IS_UPDATING,
EFFECT_IS_UPDATING,
STALE_REACTION,
ERROR_VALUE
} from './constants.js';
@ -94,7 +93,7 @@ export let source_ownership = null;
/** @param {Value} value */
export function push_reaction_value(value) {
if (active_reaction !== null && active_reaction.f & EFFECT_IS_UPDATING) {
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {
if (source_ownership === null) {
source_ownership = { reaction: active_reaction, sources: [value] };
} else {
@ -287,10 +286,6 @@ export function update_reaction(reaction) {
untracking = false;
read_version++;
if (!async_mode_flag || (reaction.f & DERIVED) !== 0) {
reaction.f |= EFFECT_IS_UPDATING;
}
if (reaction.ac !== null) {
reaction.ac.abort(STALE_REACTION);
reaction.ac = null;
@ -381,10 +376,6 @@ export function update_reaction(reaction) {
source_ownership = previous_reaction_sources;
set_component_context(previous_component_context);
untracking = previous_untracking;
if (!async_mode_flag || (reaction.f & DERIVED) !== 0) {
reaction.f ^= EFFECT_IS_UPDATING;
}
}
}

Loading…
Cancel
Save