@tinkoff/router 0.7.6 → 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/lib/router/browser.browser.js +15 -15
- package/lib/router/browser.d.ts +1 -0
- package/package.json +2 -2
|
@@ -171,21 +171,7 @@ class Router extends ClientRouter {
|
|
|
171
171
|
delayResolve();
|
|
172
172
|
}
|
|
173
173
|
async flattenDelayedNavigation(navigation) {
|
|
174
|
-
|
|
175
|
-
await this.resolveIfDelayFound(super.run(nav));
|
|
176
|
-
// if new navigation has been called while this navigation lasts
|
|
177
|
-
// call new navigation execution
|
|
178
|
-
if (this.delayedNavigation) {
|
|
179
|
-
const { delayedNavigation } = this;
|
|
180
|
-
logger.info({
|
|
181
|
-
event: 'delay-navigation-run',
|
|
182
|
-
navigation: delayedNavigation,
|
|
183
|
-
});
|
|
184
|
-
this.delayedNavigation = null;
|
|
185
|
-
return flatten(delayedNavigation);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
return flatten(navigation)
|
|
174
|
+
return this._flatten(navigation)
|
|
189
175
|
.then(() => {
|
|
190
176
|
this.delayedResolve?.();
|
|
191
177
|
}, (err) => {
|
|
@@ -283,6 +269,20 @@ class Router extends ClientRouter {
|
|
|
283
269
|
this.currentNavigation = null;
|
|
284
270
|
}
|
|
285
271
|
}
|
|
272
|
+
async _flatten(nav) {
|
|
273
|
+
await this.resolveIfDelayFound(super.run(nav));
|
|
274
|
+
// if new navigation has been called while this navigation lasts
|
|
275
|
+
// call new navigation execution
|
|
276
|
+
if (this.delayedNavigation) {
|
|
277
|
+
const { delayedNavigation } = this;
|
|
278
|
+
logger.info({
|
|
279
|
+
event: 'delay-navigation-run',
|
|
280
|
+
navigation: delayedNavigation,
|
|
281
|
+
});
|
|
282
|
+
this.delayedNavigation = null;
|
|
283
|
+
return this._flatten(delayedNavigation);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
export { Router };
|
package/lib/router/browser.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkoff/router",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "router",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"use-sync-external-store": "^1.4.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@tramvai/core": "7.2.
|
|
31
|
+
"@tramvai/core": "7.2.2",
|
|
32
32
|
"react": ">=16.14.0",
|
|
33
33
|
"tslib": "^2.4.0"
|
|
34
34
|
},
|