webdetta 0.1.241 → 0.1.242
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/package.json
CHANGED
|
@@ -11,6 +11,7 @@ const RouterRealdom = ({
|
|
|
11
11
|
const currentRoute = r.val();
|
|
12
12
|
const loadedRoutes = r.val(new Map());
|
|
13
13
|
const listener = ({ key, value: page, params }) => {
|
|
14
|
+
// 2
|
|
14
15
|
const loaded = loadedRoutes();
|
|
15
16
|
const paramKeys = Object.keys({ ...params, ...(paramVals[key] ?? {}) });
|
|
16
17
|
for (const param of paramKeys) {
|
|
@@ -22,22 +23,22 @@ const RouterRealdom = ({
|
|
|
22
23
|
const dom = RouterRealdom.ctx.run(router, () => {
|
|
23
24
|
return page(proxy);
|
|
24
25
|
});
|
|
25
|
-
loaded.set(key,
|
|
26
|
+
loaded.set(key, dom);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
loadedRoutes(loaded);
|
|
29
30
|
currentRoute(key);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
router.listen(listener);
|
|
32
|
+
router.listen((...a) => r.untrack(listener.bind(null, ...a)));
|
|
33
33
|
router.attach();
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
35
|
+
r.effect(() => {
|
|
36
|
+
for (const [key, dom] of loadedRoutes()) {
|
|
37
|
+
dom.style.display = currentRoute() == key ? 'flex' : 'none';
|
|
38
|
+
}
|
|
40
39
|
});
|
|
40
|
+
|
|
41
|
+
const container = el.list(loadedRoutes, dom => dom);
|
|
41
42
|
return { container, router };
|
|
42
43
|
};
|
|
43
44
|
RouterRealdom.ctx = Context();
|