@thepassle/app-tools 0.7.5 → 0.7.7
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 +1 -1
- package/router/index.js +0 -2
- package/router/plugins/data.js +1 -5
- package/router/types.d.ts +2 -3
package/package.json
CHANGED
package/router/index.js
CHANGED
|
@@ -25,7 +25,6 @@ export class Router extends EventTarget {
|
|
|
25
25
|
query: {},
|
|
26
26
|
title: '',
|
|
27
27
|
url: new URL(window.location.href),
|
|
28
|
-
dispatch: this._notifyUrlChanged.bind(this)
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
/**
|
|
@@ -94,7 +93,6 @@ export class Router extends EventTarget {
|
|
|
94
93
|
title: typeof title === 'function' ? title({params, query, url}) : title,
|
|
95
94
|
params,
|
|
96
95
|
query,
|
|
97
|
-
dispatch: this._notifyUrlChanged.bind(this)
|
|
98
96
|
}
|
|
99
97
|
return route;
|
|
100
98
|
}
|
package/router/plugins/data.js
CHANGED
|
@@ -6,11 +6,7 @@ export function data(promise){
|
|
|
6
6
|
return {
|
|
7
7
|
name: 'data',
|
|
8
8
|
beforeNavigation: async (context) => {
|
|
9
|
-
const data = promise(context)
|
|
10
|
-
context.data = data;
|
|
11
|
-
context.dispatch();
|
|
12
|
-
return data;
|
|
13
|
-
});
|
|
9
|
+
const data = promise(context);
|
|
14
10
|
context.data = data;
|
|
15
11
|
}
|
|
16
12
|
}
|
package/router/types.d.ts
CHANGED
|
@@ -16,10 +16,9 @@ export interface Plugin {
|
|
|
16
16
|
|
|
17
17
|
export interface Context {
|
|
18
18
|
title?: string;
|
|
19
|
-
query:
|
|
20
|
-
params:
|
|
19
|
+
query: Record<string, string>;
|
|
20
|
+
params: Record<string, string>;
|
|
21
21
|
url: URL;
|
|
22
|
-
dispatch: () => void;
|
|
23
22
|
[key: string]: any;
|
|
24
23
|
}
|
|
25
24
|
|