chore: default remove_dom to false (#12267)

pull/12268/head
Rich Harris 6 months ago committed by GitHub
parent 5ce7599f3d
commit ebf72beb73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -63,15 +63,16 @@ export function derived_safe_equal(fn) {
} }
/** /**
* @param {import('#client').Derived} signal * @param {import('#client').Derived} derived
* @returns {void} * @returns {void}
*/ */
function destroy_derived_children(signal) { function destroy_derived_children(derived) {
destroy_effect_children(signal); destroy_effect_children(derived);
var deriveds = signal.deriveds; var deriveds = derived.deriveds;
if (deriveds !== null) { if (deriveds !== null) {
signal.deriveds = null; derived.deriveds = null;
for (var i = 0; i < deriveds.length; i += 1) { for (var i = 0; i < deriveds.length; i += 1) {
destroy_derived(deriveds[i]); destroy_derived(deriveds[i]);
} }

@ -438,18 +438,17 @@ export function remove_reactions(signal, start_index) {
/** /**
* @param {import('#client').Reaction} signal * @param {import('#client').Reaction} signal
* @param {boolean} [remove_dom] * @param {boolean} remove_dom
* @returns {void} * @returns {void}
*/ */
export function destroy_effect_children(signal, remove_dom = true) { export function destroy_effect_children(signal, remove_dom = false) {
let effect = signal.first; var effect = signal.first;
signal.first = null; signal.first = signal.last = null;
signal.last = null;
var sibling;
while (effect !== null) { while (effect !== null) {
sibling = effect.next; var next = effect.next;
destroy_effect(effect, remove_dom); destroy_effect(effect, remove_dom);
effect = sibling; effect = next;
} }
} }

Loading…
Cancel
Save