src/utils/vdom-diff.js
function removeNotNeededNodes(parentElements, newChildren, oldChildren) {
  let remaining = parentElements.childNodes.length;
  if (oldChildren.length !== remaining) {
    console.warn(
      "ZLIQ: Something other then ZLIQ has manipulated the children of the element",
      parentElements,
      ". This can lead to sideffects. Consider using the 'isolated' attribute for this element to prevent updates."
    );
  }

  for (; remaining > newChildren.length; remaining--) {
    let childToRemove = parentElements.childNodes[remaining - 1];
    parentElements.removeChild(childToRemove);

    if (oldChildren.length < remaining) {
      continue;
    } else {
      let { cycle } = oldChildren[remaining - 1];

      triggerLifecycle(childToRemove, { cycle }, "removed");
    }
  }
}
function removeNotNeededNodes(parentElements, newChildren, oldChildren) {
  let remaining = parentElements.childNodes.length;
  if (oldChildren.length !== remaining) {
    console.warn(
      "ZLIQ: Something other then ZLIQ has manipulated the children of the element",
      parentElements,
      ". This can lead to sideffects. Consider using the 'isolated' attribute for this element to prevent updates."
    );
  }

  for (; remaining > newChildren.length; remaining--) {
    let childToRemove = parentElements.childNodes[remaining - 1];
    parentElements.removeChild(childToRemove);

    if (oldChildren.length < remaining) {
      continue;
    } else {
      let { cycle } = oldChildren[remaining - 1];

      triggerLifecycle(childToRemove, { cycle }, "removed");
    }
  }
}
function removeNotNeededNodes ( parentElements , newChildren , oldChildren ) { let remaining = parentElements . childNodes . length ; if ( oldChildren . length !== remaining ) { console . warn ( "ZLIQ: Something other then ZLIQ has manipulated the children of the element" , parentElements , ". This can lead to sideffects. Consider using the 'isolated' attribute for this element to prevent updates." ) ; } for ( ; remaining > newChildren . length ; remaining -- ) { let childToRemove = parentElements . childNodes [ remaining - 1 ] ; parentElements . removeChild ( childToRemove ) ; if ( oldChildren . length < remaining ) { continue ; } else { let { cycle } = oldChildren [ remaining - 1 ] ; triggerLifecycle ( childToRemove , { cycle } , "removed" ) ; } } }
this removes nodes at the end of the children, that are not needed anymore in the current state for recycling
this removes nodes at the end of the children that are not needed anymore in the current state for recycling