consistency fix 2

fix-untrack-expose-unsafe
Dominic Gannaway 9 months ago
parent 3614f37177
commit 8bf08ff422

@ -539,12 +539,13 @@ export function update_effect(effect) {
execute_effect_teardown(effect); execute_effect_teardown(effect);
var teardown = update_reaction(effect); var teardown = update_reaction(effect);
var is_init = effect.version === 0;
effect.teardown = typeof teardown === 'function' ? teardown : null; effect.teardown = typeof teardown === 'function' ? teardown : null;
// If unsafe() has been used within the effect, then we might need // If unsafe() has been used within the effect on the first time
// to schedule another update for this effect in case the unsafe mutation // it's run, then we might need to schedule the effect to run again
// has caused a this effect to become invalidated again // if it has a dependency that has been invalidated
if (unsafe_mutation_inside_effect && (effect.f & CLEAN) !== 0) { if (unsafe_mutation_inside_effect && is_init && (effect.f & CLEAN) !== 0) {
set_signal_status(effect, MAYBE_DIRTY); set_signal_status(effect, MAYBE_DIRTY);
if (check_dirtiness(effect)) { if (check_dirtiness(effect)) {
set_signal_status(effect, DIRTY); set_signal_status(effect, DIRTY);

Loading…
Cancel
Save