From 9c0acb83f821e31a4be66388580fdd40f122a6b2 Mon Sep 17 00:00:00 2001 From: natxocc Date: Wed, 8 Apr 2026 12:27:00 +0200 Subject: [PATCH] Correct small errors --- sw.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sw.js b/sw.js index 0066108..fa63b4e 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,6 @@ const isFunction = (value) => typeof value === 'function'; const isNode = (value) => value instanceof Node; -const get = (sig) => (sig?._isSignal ? sig.value : (isFn(sig) ? sig() : sig)); +const get = (sig) => (sig?._isSignal ? sig.value : (isFunction(sig) ? sig() : sig)); // --- Schedule System --- let isScheduled = false; @@ -300,7 +300,7 @@ export const Router = (routes) => { } } const fallback = routes.find(r => r.path === '*'); - return fallback ? h(fbk.component) : '404'; + return fallback ? h(fallback.component) : '404'; }); }; @@ -314,6 +314,11 @@ export const mount = (root, target, props = {}) => { const el = h(root, props); container.appendChild(el); + if (el.$context) { + el.$context.mountHooks.forEach(hook => hook()); + el.$context.mountHooks.length = 0; + } + return () => remove(el); };