robbyson-frontend-library 0.0.1-rc2 → 0.0.1-rc3
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
|
@@ -125,4 +125,15 @@ export class BaseRepository {
|
|
|
125
125
|
|
|
126
126
|
return config;
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
protected createAxiosCancelationContext(): void {
|
|
130
|
+
BaseRepository._source = axios.CancelToken.source();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
protected cancelAxiosRequest(): void {
|
|
134
|
+
if (BaseRepository._source) {
|
|
135
|
+
BaseRepository._source.cancel();
|
|
136
|
+
BaseRepository._source = null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
128
139
|
}
|
|
@@ -38,6 +38,33 @@ export class RobbysonNavigate {
|
|
|
38
38
|
history.replace(replace, state);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
static getRouteId(): string {
|
|
42
|
+
RobbysonNavigate._globalStore = GlobalStore.Get();
|
|
43
|
+
RobbysonNavigate._globalState =
|
|
44
|
+
RobbysonNavigate._globalStore.GetGlobalState();
|
|
45
|
+
|
|
46
|
+
const { history } = RobbysonNavigate._globalState.Global.RootApp;
|
|
47
|
+
|
|
48
|
+
const routeParams = history.location.pathname.split("/");
|
|
49
|
+
const id = routeParams[routeParams.length - 1];
|
|
50
|
+
|
|
51
|
+
return id;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static getPathname(): string {
|
|
55
|
+
RobbysonNavigate._globalStore = GlobalStore.Get();
|
|
56
|
+
RobbysonNavigate._globalState =
|
|
57
|
+
RobbysonNavigate._globalStore.GetGlobalState();
|
|
58
|
+
|
|
59
|
+
const { history } = RobbysonNavigate._globalState.Global.RootApp;
|
|
60
|
+
|
|
61
|
+
return history.location.pathname;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static matchPath(path: string): boolean {
|
|
65
|
+
return RobbysonNavigate.getPathname().includes(path)
|
|
66
|
+
}
|
|
67
|
+
|
|
41
68
|
static getQueryParams<T>(): T {
|
|
42
69
|
RobbysonNavigate._globalStore = GlobalStore.Get();
|
|
43
70
|
RobbysonNavigate._globalState =
|