chore: remove isConnected usage

remove-is-connected
Dominic Gannaway 6 months ago
parent 92909834f0
commit 95348aad03

@ -14,11 +14,9 @@ export function remove(current) {
if (is_array(current)) { if (is_array(current)) {
for (var i = 0; i < current.length; i++) { for (var i = 0; i < current.length; i++) {
var node = current[i]; var node = current[i];
if (node.isConnected) { node.remove();
node.remove();
}
} }
} else if (current.isConnected) { } else {
current.remove(); current.remove();
} }
} }

@ -246,12 +246,12 @@ export function destroy_effect(effect) {
effect.teardown?.call(null); effect.teardown?.call(null);
if (effect.dom !== null) { var parent = effect.parent;
if (effect.dom !== null && (parent === null || (parent.f & DESTROYED) === 0)) {
remove(effect.dom); remove(effect.dom);
} }
var parent = effect.parent;
// If the parent doesn't have any children, then skip this work altogether // If the parent doesn't have any children, then skip this work altogether
if (parent !== null && (effect.f & BRANCH_EFFECT) !== 0 && parent.first !== null) { if (parent !== null && (effect.f & BRANCH_EFFECT) !== 0 && parent.first !== null) {
var previous = effect.prev; var previous = effect.prev;

Loading…
Cancel
Save