revojs 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -589,19 +589,18 @@ function hydrate(scope, parentNode, slot, index, previous) {
|
|
|
589
589
|
let input = slot;
|
|
590
590
|
while (typeof input === "function") input = input();
|
|
591
591
|
hydration = hydrate(scope$1, parentNode, input, index, previous$1);
|
|
592
|
-
if (previous$1 && hydration !== previous$1) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
592
|
+
if (previous$1 && hydration !== previous$1) if (Array.isArray(hydration)) if (Array.isArray(previous$1)) {
|
|
593
|
+
const range = toRange(previous$1);
|
|
594
|
+
range.deleteContents();
|
|
595
|
+
for (const childNode of toArray(hydration)) range.insertNode(childNode);
|
|
596
|
+
} else if (parentNode.contains(previous$1)) parentNode.replaceChild(toFragment(hydration), previous$1);
|
|
597
|
+
else parentNode.replaceChild(toFragment(hydration), parentNode.childNodes.item(index));
|
|
598
|
+
else if (Array.isArray(previous$1)) {
|
|
599
|
+
const range = toRange(previous$1);
|
|
600
|
+
range.deleteContents();
|
|
601
|
+
range.insertNode(hydration);
|
|
602
|
+
} else if (parentNode.contains(previous$1)) parentNode.replaceChild(hydration, previous$1);
|
|
603
|
+
else parentNode.replaceChild(hydration, parentNode.childNodes.item(index));
|
|
605
604
|
previous$1 = hydration;
|
|
606
605
|
});
|
|
607
606
|
}
|