revojs 0.0.40 → 0.0.41

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -275,22 +275,25 @@ const hydrate = async (scope, parentNode, slot, index, previous) => {
275
275
  if (items.length) hydration = items;
276
276
  else if (previous || !(hydration instanceof Comment)) hydration = document.createComment("");
277
277
  }
278
- if (typeof slot === "function") await createCompute(scope, async (scope$1) => {
279
- let input = slot;
280
- while (typeof input === "function") input = await input();
281
- hydration = await hydrate(scope$1, parentNode, input, index, previous);
282
- if (previous && hydration !== previous) if (Array.isArray(hydration)) if (Array.isArray(previous)) {
283
- const range = toRange(previous);
284
- range.deleteContents();
285
- for (const childNode of toArray(hydration)) range.insertNode(childNode);
286
- } else parentNode.replaceChild(toFragment(hydration), previous);
287
- else if (Array.isArray(previous)) {
288
- const range = toRange(previous);
289
- range.deleteContents();
290
- range.insertNode(hydration);
291
- } else parentNode.replaceChild(hydration, previous);
292
- previous = hydration;
293
- });
278
+ if (typeof slot === "function") {
279
+ let previous$1;
280
+ await createCompute(scope, async (scope$1) => {
281
+ let input = slot;
282
+ while (typeof input === "function") input = await input();
283
+ hydration = await hydrate(scope$1, parentNode, input, index, previous$1);
284
+ if (previous$1 && hydration !== previous$1) if (Array.isArray(hydration)) if (Array.isArray(previous$1)) {
285
+ const range = toRange(previous$1);
286
+ range.deleteContents();
287
+ for (const childNode of toArray(hydration)) range.insertNode(childNode);
288
+ } else parentNode.replaceChild(toFragment(hydration), previous$1);
289
+ else if (Array.isArray(previous$1)) {
290
+ const range = toRange(previous$1);
291
+ range.deleteContents();
292
+ range.insertNode(hydration);
293
+ } else parentNode.replaceChild(hydration, previous$1);
294
+ previous$1 = hydration;
295
+ });
296
+ }
294
297
  if ((slot === null || slot === void 0) && (previous || !(hydration instanceof Comment))) hydration = document.createComment("");
295
298
  if (typeof slot === "number" || typeof slot === "bigint" || typeof slot === "boolean" || typeof slot === "string" || typeof slot === "symbol") {
296
299
  const textContent = slot.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revojs",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",