@esportsplus/routing 0.6.2 → 0.6.4
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/build/client/index.js +10 -10
- package/package.json +3 -3
package/build/client/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as reactivity_8c8cd937fd534d33a0fea8e759e572be0 from '@esportsplus/reactivity';
|
|
2
2
|
import { effect, root } from '@esportsplus/reactivity';
|
|
3
3
|
import { Router } from './router/index.js';
|
|
4
4
|
import pipeline from '@esportsplus/pipeline';
|
|
5
5
|
import { PACKAGE_NAME } from './constants.js';
|
|
6
|
-
class
|
|
6
|
+
class ReactiveObject_8c8cd937fd534d33a0fea8e759e572be1 extends reactivity_8c8cd937fd534d33a0fea8e759e572be0.ReactiveObject {
|
|
7
7
|
#parameters;
|
|
8
8
|
#route;
|
|
9
9
|
constructor(_p0, _p1) {
|
|
10
10
|
super(null);
|
|
11
|
-
this.#parameters = this[
|
|
12
|
-
this.#route = this[
|
|
11
|
+
this.#parameters = this[reactivity_8c8cd937fd534d33a0fea8e759e572be0.SIGNAL](_p0);
|
|
12
|
+
this.#route = this[reactivity_8c8cd937fd534d33a0fea8e759e572be0.SIGNAL](_p1);
|
|
13
13
|
}
|
|
14
14
|
get parameters() {
|
|
15
|
-
return
|
|
15
|
+
return reactivity_8c8cd937fd534d33a0fea8e759e572be0.read(this.#parameters);
|
|
16
16
|
}
|
|
17
17
|
set parameters(_v0) {
|
|
18
|
-
|
|
18
|
+
reactivity_8c8cd937fd534d33a0fea8e759e572be0.write(this.#parameters, _v0);
|
|
19
19
|
}
|
|
20
20
|
get route() {
|
|
21
|
-
return
|
|
21
|
+
return reactivity_8c8cd937fd534d33a0fea8e759e572be0.read(this.#route);
|
|
22
22
|
}
|
|
23
23
|
set route(_v1) {
|
|
24
|
-
|
|
24
|
+
reactivity_8c8cd937fd534d33a0fea8e759e572be0.write(this.#route, _v1);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
let cache = [], location = window.location;
|
|
@@ -80,7 +80,7 @@ function middleware(request, router) {
|
|
|
80
80
|
return route.pipeline.dispatch(request);
|
|
81
81
|
};
|
|
82
82
|
host.match = (fallback) => {
|
|
83
|
-
let state = new
|
|
83
|
+
let state = new ReactiveObject_8c8cd937fd534d33a0fea8e759e572be1(undefined, undefined);
|
|
84
84
|
if (fallback === undefined) {
|
|
85
85
|
throw new Error(`${PACKAGE_NAME}: fallback route does not exist`);
|
|
86
86
|
}
|
|
@@ -120,7 +120,7 @@ function onpopstate() {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
const router = (...factories) => {
|
|
123
|
-
let instance = factories.reduce((r, factory) => factory(r), new Router()), request =
|
|
123
|
+
let instance = factories.reduce((r, factory) => factory(r), new Router()), request = reactivity_8c8cd937fd534d33a0fea8e759e572be0.reactive(Object.assign(href(), { data: {} }));
|
|
124
124
|
if (cache.push(request) === 1) {
|
|
125
125
|
window.addEventListener('hashchange', onpopstate);
|
|
126
126
|
}
|
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"author": "ICJR",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@esportsplus/pipeline": "^1.2.2",
|
|
5
|
-
"@esportsplus/reactivity": "^0.29.
|
|
6
|
-
"@esportsplus/typescript": "^0.28.
|
|
5
|
+
"@esportsplus/reactivity": "^0.29.22",
|
|
6
|
+
"@esportsplus/typescript": "^0.28.4",
|
|
7
7
|
"@esportsplus/utilities": "^0.27.2"
|
|
8
8
|
},
|
|
9
9
|
"exports": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
31
|
"types": "./build/index.d.ts",
|
|
32
|
-
"version": "0.6.
|
|
32
|
+
"version": "0.6.4",
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc",
|
|
35
35
|
"build:test": "vite build --config test/vite.config.ts",
|