get rid of force_schedule

pull/12073/head
Rich Harris 4 months ago
parent 213af7f5dd
commit 021b5b4767

@ -4,7 +4,6 @@ import {
current_effect, current_effect,
remove_reactions, remove_reactions,
set_signal_status, set_signal_status,
mark_reactions,
current_skip_reaction, current_skip_reaction,
execute_reaction_fn, execute_reaction_fn,
destroy_effect_children, destroy_effect_children,
@ -80,10 +79,9 @@ function destroy_derived_children(signal) {
/** /**
* @param {import('#client').Derived} derived * @param {import('#client').Derived} derived
* @param {boolean} force_schedule
* @returns {void} * @returns {void}
*/ */
export function update_derived(derived, force_schedule) { export function update_derived(derived) {
var previous_updating_derived = updating_derived; var previous_updating_derived = updating_derived;
updating_derived = true; updating_derived = true;
destroy_derived_children(derived); destroy_derived_children(derived);

@ -91,7 +91,7 @@ export function set(source, value) {
source.v = value; source.v = value;
source.version = increment_version(); source.version = increment_version();
mark_reactions(source, true); mark_reactions(source);
// If the current signal is running for the first time, it won't have any // If the current signal is running for the first time, it won't have any
// reactions as we only allocate and assign the reactions after the signal // reactions as we only allocate and assign the reactions after the signal

@ -172,7 +172,7 @@ export function check_dirtiness(reaction) {
var dependency = dependencies[i]; var dependency = dependencies[i];
if (!is_dirty && check_dirtiness(/** @type {import('#client').Derived} */ (dependency))) { if (!is_dirty && check_dirtiness(/** @type {import('#client').Derived} */ (dependency))) {
update_derived(/** @type {import('#client').Derived} **/ (dependency), true); update_derived(/** @type {import('#client').Derived} **/ (dependency));
} }
if (is_derived) { if (is_derived) {
@ -762,7 +762,7 @@ export function get(signal) {
(flags & DERIVED) !== 0 && (flags & DERIVED) !== 0 &&
check_dirtiness(/** @type {import('#client').Derived} */ (signal)) check_dirtiness(/** @type {import('#client').Derived} */ (signal))
) { ) {
update_derived(/** @type {import('#client').Derived} **/ (signal), false); update_derived(/** @type {import('#client').Derived} **/ (signal));
} }
return signal.v; return signal.v;
@ -807,10 +807,9 @@ export function invalidate_inner_signals(fn) {
/** /**
* @param {import('#client').Value} signal * @param {import('#client').Value} signal
* @param {boolean} force_schedule
* @returns {void} * @returns {void}
*/ */
export function mark_reactions(signal, force_schedule) { export function mark_reactions(signal) {
var reactions = signal.reactions; var reactions = signal.reactions;
if (reactions === null) return; if (reactions === null) return;
@ -836,7 +835,7 @@ export function mark_reactions(signal, force_schedule) {
// We skip any effects that are already dirty. Additionally, we also // We skip any effects that are already dirty. Additionally, we also
// skip if the reaction is the same as the current effect (except if we're not in runes or we // skip if the reaction is the same as the current effect (except if we're not in runes or we
// are in force schedule mode). // are in force schedule mode).
if ((flags & DIRTY) !== 0 || ((!force_schedule || !runes) && reaction === current_effect)) { if ((flags & DIRTY) !== 0 || (!runes && reaction === current_effect)) {
continue; continue;
} }

Loading…
Cancel
Save