@ngxs/router-plugin 3.7.5 → 3.7.6-dev.master-a585f14
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/bundles/ngxs-router-plugin.umd.js +267 -94
- package/bundles/ngxs-router-plugin.umd.js.map +1 -1
- package/bundles/ngxs-router-plugin.umd.min.js +1 -1
- package/bundles/ngxs-router-plugin.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/ngxs-router-plugin.js +3 -2
- package/esm2015/src/public_api.js +2 -2
- package/esm2015/src/router.actions.js +63 -1
- package/esm2015/src/router.module.js +13 -3
- package/esm2015/src/router.state.js +120 -80
- package/esm2015/src/symbols.js +39 -0
- package/esm5/index.js +2 -2
- package/esm5/ngxs-router-plugin.js +3 -2
- package/esm5/src/public_api.js +2 -2
- package/esm5/src/router.actions.js +89 -7
- package/esm5/src/router.module.js +14 -3
- package/esm5/src/router.state.js +145 -95
- package/esm5/src/symbols.js +39 -0
- package/fesm2015/ngxs-router-plugin.js +227 -80
- package/fesm2015/ngxs-router-plugin.js.map +1 -1
- package/fesm5/ngxs-router-plugin.js +264 -96
- package/fesm5/ngxs-router-plugin.js.map +1 -1
- package/ngxs-router-plugin.d.ts +1 -0
- package/ngxs-router-plugin.metadata.json +1 -1
- package/package.json +5 -5
- package/src/public_api.d.ts +1 -0
- package/src/router.actions.d.ts +22 -2
- package/src/router.module.d.ts +2 -1
- package/src/router.state.d.ts +21 -15
- package/src/symbols.d.ts +11 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgZone, Injectable, NgModule } from '@angular/core';
|
|
1
|
+
import { InjectionToken, NgZone, Injector, Injectable, NgModule } from '@angular/core';
|
|
2
2
|
import { Store, Action, Selector, State, NgxsModule } from '@ngxs/store';
|
|
3
3
|
import { __decorate, __metadata } from 'tslib';
|
|
4
4
|
import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router } from '@angular/router';
|
|
@@ -43,6 +43,37 @@ if (false) {
|
|
|
43
43
|
* Angular Routers internal state events
|
|
44
44
|
*
|
|
45
45
|
*/
|
|
46
|
+
/**
|
|
47
|
+
* An action dispatched when the router starts the navigation.
|
|
48
|
+
* @template T
|
|
49
|
+
*/
|
|
50
|
+
class RouterRequest {
|
|
51
|
+
/**
|
|
52
|
+
* @param {?} routerState
|
|
53
|
+
* @param {?} event
|
|
54
|
+
* @param {?=} trigger
|
|
55
|
+
*/
|
|
56
|
+
constructor(routerState, event, trigger = 'none') {
|
|
57
|
+
this.routerState = routerState;
|
|
58
|
+
this.event = event;
|
|
59
|
+
this.trigger = trigger;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @return {?}
|
|
63
|
+
*/
|
|
64
|
+
static get type() {
|
|
65
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
66
|
+
return '[Router] RouterRequest';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (false) {
|
|
70
|
+
/** @type {?} */
|
|
71
|
+
RouterRequest.prototype.routerState;
|
|
72
|
+
/** @type {?} */
|
|
73
|
+
RouterRequest.prototype.event;
|
|
74
|
+
/** @type {?} */
|
|
75
|
+
RouterRequest.prototype.trigger;
|
|
76
|
+
}
|
|
46
77
|
/**
|
|
47
78
|
* An action dispatched when the router navigates.
|
|
48
79
|
* @template T
|
|
@@ -175,6 +206,37 @@ if (false) {
|
|
|
175
206
|
/** @type {?} */
|
|
176
207
|
RouterDataResolved.prototype.trigger;
|
|
177
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* An action dispatched when the router navigation has been finished successfully.
|
|
211
|
+
* @template T
|
|
212
|
+
*/
|
|
213
|
+
class RouterNavigated {
|
|
214
|
+
/**
|
|
215
|
+
* @param {?} routerState
|
|
216
|
+
* @param {?} event
|
|
217
|
+
* @param {?=} trigger
|
|
218
|
+
*/
|
|
219
|
+
constructor(routerState, event, trigger = 'none') {
|
|
220
|
+
this.routerState = routerState;
|
|
221
|
+
this.event = event;
|
|
222
|
+
this.trigger = trigger;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @return {?}
|
|
226
|
+
*/
|
|
227
|
+
static get type() {
|
|
228
|
+
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
229
|
+
return '[Router] RouterNavigated';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (false) {
|
|
233
|
+
/** @type {?} */
|
|
234
|
+
RouterNavigated.prototype.routerState;
|
|
235
|
+
/** @type {?} */
|
|
236
|
+
RouterNavigated.prototype.event;
|
|
237
|
+
/** @type {?} */
|
|
238
|
+
RouterNavigated.prototype.trigger;
|
|
239
|
+
}
|
|
178
240
|
|
|
179
241
|
/**
|
|
180
242
|
* @fileoverview added by tsickle
|
|
@@ -248,6 +310,43 @@ class DefaultRouterStateSerializer {
|
|
|
248
310
|
}
|
|
249
311
|
}
|
|
250
312
|
|
|
313
|
+
/**
|
|
314
|
+
* @fileoverview added by tsickle
|
|
315
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
316
|
+
*/
|
|
317
|
+
/** @enum {number} */
|
|
318
|
+
const NavigationActionTiming = {
|
|
319
|
+
PreActivation: 1,
|
|
320
|
+
PostActivation: 2,
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* @record
|
|
324
|
+
*/
|
|
325
|
+
function NgxsRouterPluginOptions() { }
|
|
326
|
+
if (false) {
|
|
327
|
+
/** @type {?|undefined} */
|
|
328
|
+
NgxsRouterPluginOptions.prototype.navigationActionTiming;
|
|
329
|
+
}
|
|
330
|
+
/** @type {?} */
|
|
331
|
+
const USER_OPTIONS = new InjectionToken('USER_OPTIONS', { providedIn: 'root', factory: (/**
|
|
332
|
+
* @return {?}
|
|
333
|
+
*/
|
|
334
|
+
() => undefined) });
|
|
335
|
+
/** @type {?} */
|
|
336
|
+
const NGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken('NGXS_ROUTER_PLUGIN_OPTIONS', { providedIn: 'root', factory: (/**
|
|
337
|
+
* @return {?}
|
|
338
|
+
*/
|
|
339
|
+
() => ({})) });
|
|
340
|
+
/**
|
|
341
|
+
* @param {?} options
|
|
342
|
+
* @return {?}
|
|
343
|
+
*/
|
|
344
|
+
function createRouterPluginOptions(options) {
|
|
345
|
+
return {
|
|
346
|
+
navigationActionTiming: (options && options.navigationActionTiming) || 1 /* PreActivation */
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
251
350
|
var RouterState_1;
|
|
252
351
|
/**
|
|
253
352
|
* @record
|
|
@@ -268,8 +367,9 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
268
367
|
* @param {?} _router
|
|
269
368
|
* @param {?} _serializer
|
|
270
369
|
* @param {?} _ngZone
|
|
370
|
+
* @param {?} injector
|
|
271
371
|
*/
|
|
272
|
-
constructor(_store, _router, _serializer, _ngZone) {
|
|
372
|
+
constructor(_store, _router, _serializer, _ngZone, injector) {
|
|
273
373
|
this._store = _store;
|
|
274
374
|
this._router = _router;
|
|
275
375
|
this._serializer = _serializer;
|
|
@@ -287,10 +387,14 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
287
387
|
* That's the value of the `RouterState` state
|
|
288
388
|
*/
|
|
289
389
|
this._storeState = null;
|
|
290
|
-
this.
|
|
390
|
+
this._lastEvent = null;
|
|
291
391
|
this._subscription = new Subscription();
|
|
292
|
-
this.
|
|
293
|
-
|
|
392
|
+
this._options = null;
|
|
393
|
+
// Note: do not use `@Inject` since it fails on lower versions of Angular with Jest
|
|
394
|
+
// integration, it cannot resolve the token provider.
|
|
395
|
+
this._options = injector.get(NGXS_ROUTER_PLUGIN_OPTIONS, null);
|
|
396
|
+
this._setUpStoreListener();
|
|
397
|
+
this._setUpRouterEventsListener();
|
|
294
398
|
}
|
|
295
399
|
/**
|
|
296
400
|
* @template T
|
|
@@ -330,13 +434,17 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
330
434
|
* @return {?}
|
|
331
435
|
*/
|
|
332
436
|
angularRouterAction(ctx, action) {
|
|
333
|
-
ctx.setState(
|
|
437
|
+
ctx.setState({
|
|
438
|
+
trigger: action.trigger,
|
|
439
|
+
state: action.routerState,
|
|
440
|
+
navigationId: action.event.id
|
|
441
|
+
});
|
|
334
442
|
}
|
|
335
443
|
/**
|
|
336
444
|
* @private
|
|
337
445
|
* @return {?}
|
|
338
446
|
*/
|
|
339
|
-
|
|
447
|
+
_setUpStoreListener() {
|
|
340
448
|
/** @type {?} */
|
|
341
449
|
const subscription = this._store
|
|
342
450
|
.select(RouterState_1)
|
|
@@ -345,123 +453,148 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
345
453
|
* @return {?}
|
|
346
454
|
*/
|
|
347
455
|
(state) => {
|
|
348
|
-
this.
|
|
456
|
+
this._navigateIfNeeded(state);
|
|
349
457
|
}));
|
|
350
458
|
this._subscription.add(subscription);
|
|
351
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* @private
|
|
462
|
+
* @param {?} routerState
|
|
463
|
+
* @return {?}
|
|
464
|
+
*/
|
|
465
|
+
_navigateIfNeeded(routerState) {
|
|
466
|
+
if (routerState && routerState.trigger === 'devtools') {
|
|
467
|
+
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
468
|
+
}
|
|
469
|
+
/** @type {?} */
|
|
470
|
+
const canSkipNavigation = !this._storeState ||
|
|
471
|
+
!this._storeState.state ||
|
|
472
|
+
!routerState ||
|
|
473
|
+
routerState.trigger === 'router' ||
|
|
474
|
+
this._router.url === this._storeState.state.url ||
|
|
475
|
+
this._lastEvent instanceof NavigationStart;
|
|
476
|
+
if (canSkipNavigation) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
480
|
+
this._trigger = 'store';
|
|
481
|
+
this._ngZone.run((/**
|
|
482
|
+
* @return {?}
|
|
483
|
+
*/
|
|
484
|
+
() => this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (this._storeState)).state)).url)));
|
|
485
|
+
}
|
|
352
486
|
/**
|
|
353
487
|
* @private
|
|
354
488
|
* @return {?}
|
|
355
489
|
*/
|
|
356
|
-
|
|
490
|
+
_setUpRouterEventsListener() {
|
|
491
|
+
/** @type {?} */
|
|
492
|
+
const dispatchRouterNavigationLate = this._options != null &&
|
|
493
|
+
this._options.navigationActionTiming === 2 /* PostActivation */;
|
|
494
|
+
/** @type {?} */
|
|
495
|
+
let lastRoutesRecognized;
|
|
357
496
|
/** @type {?} */
|
|
358
497
|
const subscription = this._router.events.subscribe((/**
|
|
359
498
|
* @param {?} event
|
|
360
499
|
* @return {?}
|
|
361
500
|
*/
|
|
362
501
|
event => {
|
|
502
|
+
this._lastEvent = event;
|
|
363
503
|
if (event instanceof NavigationStart) {
|
|
364
|
-
this.
|
|
504
|
+
this._navigationStart(event);
|
|
365
505
|
}
|
|
366
506
|
else if (event instanceof RoutesRecognized) {
|
|
367
|
-
|
|
507
|
+
lastRoutesRecognized = event;
|
|
508
|
+
if (!dispatchRouterNavigationLate && this._trigger !== 'store') {
|
|
509
|
+
this._dispatchRouterNavigation(lastRoutesRecognized);
|
|
510
|
+
}
|
|
368
511
|
}
|
|
369
512
|
else if (event instanceof ResolveEnd) {
|
|
370
|
-
this.
|
|
513
|
+
this._dispatchRouterDataResolved(event);
|
|
371
514
|
}
|
|
372
515
|
else if (event instanceof NavigationCancel) {
|
|
373
|
-
this.
|
|
374
|
-
this.
|
|
516
|
+
this._dispatchRouterCancel(event);
|
|
517
|
+
this._reset();
|
|
375
518
|
}
|
|
376
519
|
else if (event instanceof NavigationError) {
|
|
377
|
-
this.
|
|
378
|
-
this.
|
|
520
|
+
this._dispatchRouterError(event);
|
|
521
|
+
this._reset();
|
|
379
522
|
}
|
|
380
523
|
else if (event instanceof NavigationEnd) {
|
|
381
|
-
this.
|
|
382
|
-
|
|
524
|
+
if (this._trigger !== 'store') {
|
|
525
|
+
if (dispatchRouterNavigationLate) {
|
|
526
|
+
this._dispatchRouterNavigation(lastRoutesRecognized);
|
|
527
|
+
}
|
|
528
|
+
this._dispatchRouterNavigated(event);
|
|
529
|
+
}
|
|
530
|
+
this._reset();
|
|
383
531
|
}
|
|
384
532
|
}));
|
|
385
533
|
this._subscription.add(subscription);
|
|
386
534
|
}
|
|
387
535
|
/**
|
|
536
|
+
* Reacts to `NavigationStart`.
|
|
388
537
|
* @private
|
|
538
|
+
* @param {?} event
|
|
389
539
|
* @return {?}
|
|
390
540
|
*/
|
|
391
|
-
|
|
541
|
+
_navigationStart(event) {
|
|
392
542
|
this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
|
|
393
543
|
if (this._trigger !== 'none') {
|
|
394
544
|
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
545
|
+
this._dispatchRouterAction(new RouterRequest(this._routerState, event, this._trigger));
|
|
395
546
|
}
|
|
396
547
|
}
|
|
397
548
|
/**
|
|
549
|
+
* Reacts to `ResolveEnd`.
|
|
398
550
|
* @private
|
|
551
|
+
* @param {?} event
|
|
399
552
|
* @return {?}
|
|
400
553
|
*/
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* @private
|
|
408
|
-
* @return {?}
|
|
409
|
-
*/
|
|
410
|
-
shouldDispatchRouterNavigation() {
|
|
411
|
-
if (!this._storeState)
|
|
412
|
-
return true;
|
|
413
|
-
return this._trigger !== 'store';
|
|
554
|
+
_dispatchRouterDataResolved(event) {
|
|
555
|
+
/** @type {?} */
|
|
556
|
+
const routerState = this._serializer.serialize(event.state);
|
|
557
|
+
this._dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
|
|
414
558
|
}
|
|
415
559
|
/**
|
|
560
|
+
* Reacts to `RoutesRecognized` or `NavigationEnd`, depends on the `navigationActionTiming`.
|
|
416
561
|
* @private
|
|
417
|
-
* @param {?}
|
|
562
|
+
* @param {?} lastRoutesRecognized
|
|
418
563
|
* @return {?}
|
|
419
564
|
*/
|
|
420
|
-
|
|
421
|
-
if (state && state.trigger === 'devtools') {
|
|
422
|
-
this._storeState = this._store.selectSnapshot(RouterState_1);
|
|
423
|
-
}
|
|
565
|
+
_dispatchRouterNavigation(lastRoutesRecognized) {
|
|
424
566
|
/** @type {?} */
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
!state ||
|
|
428
|
-
state.trigger === 'router' ||
|
|
429
|
-
this._router.url === this._storeState.state.url;
|
|
430
|
-
if (canSkipNavigation) {
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
this._trigger = 'store';
|
|
434
|
-
this._ngZone.run((/**
|
|
435
|
-
* @return {?}
|
|
436
|
-
*/
|
|
437
|
-
() => {
|
|
438
|
-
this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (this._storeState)).state)).url);
|
|
439
|
-
}));
|
|
567
|
+
const nextRouterState = this._serializer.serialize(lastRoutesRecognized.state);
|
|
568
|
+
this._dispatchRouterAction(new RouterNavigation(nextRouterState, new RoutesRecognized(lastRoutesRecognized.id, lastRoutesRecognized.url, lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
|
|
440
569
|
}
|
|
441
570
|
/**
|
|
571
|
+
* Reacts to `NavigationCancel`.
|
|
442
572
|
* @private
|
|
573
|
+
* @param {?} event
|
|
443
574
|
* @return {?}
|
|
444
575
|
*/
|
|
445
|
-
|
|
446
|
-
/** @type {?} */
|
|
447
|
-
const nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
|
|
448
|
-
this.dispatchRouterAction(new RouterNavigation(nextRouterState, new RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
|
|
576
|
+
_dispatchRouterCancel(event) {
|
|
577
|
+
this._dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
|
|
449
578
|
}
|
|
450
579
|
/**
|
|
580
|
+
* Reacts to `NavigationEnd`.
|
|
451
581
|
* @private
|
|
452
582
|
* @param {?} event
|
|
453
583
|
* @return {?}
|
|
454
584
|
*/
|
|
455
|
-
|
|
456
|
-
this.
|
|
585
|
+
_dispatchRouterError(event) {
|
|
586
|
+
this._dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new NavigationError(event.id, event.url, `${event}`), this._trigger));
|
|
457
587
|
}
|
|
458
588
|
/**
|
|
589
|
+
* Reacts to `NavigationEnd`.
|
|
459
590
|
* @private
|
|
460
591
|
* @param {?} event
|
|
461
592
|
* @return {?}
|
|
462
593
|
*/
|
|
463
|
-
|
|
464
|
-
|
|
594
|
+
_dispatchRouterNavigated(event) {
|
|
595
|
+
/** @type {?} */
|
|
596
|
+
const routerState = this._serializer.serialize(this._router.routerState.snapshot);
|
|
597
|
+
this._dispatchRouterAction(new RouterNavigated(routerState, event, this._trigger));
|
|
465
598
|
}
|
|
466
599
|
/**
|
|
467
600
|
* @private
|
|
@@ -469,7 +602,7 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
469
602
|
* @param {?} action
|
|
470
603
|
* @return {?}
|
|
471
604
|
*/
|
|
472
|
-
|
|
605
|
+
_dispatchRouterAction(action) {
|
|
473
606
|
this._trigger = 'router';
|
|
474
607
|
try {
|
|
475
608
|
this._store.dispatch(action);
|
|
@@ -480,19 +613,9 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
480
613
|
}
|
|
481
614
|
/**
|
|
482
615
|
* @private
|
|
483
|
-
* @param {?} event
|
|
484
616
|
* @return {?}
|
|
485
617
|
*/
|
|
486
|
-
|
|
487
|
-
/** @type {?} */
|
|
488
|
-
const routerState = this._serializer.serialize(event.state);
|
|
489
|
-
this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* @private
|
|
493
|
-
* @return {?}
|
|
494
|
-
*/
|
|
495
|
-
reset() {
|
|
618
|
+
_reset() {
|
|
496
619
|
this._trigger = 'none';
|
|
497
620
|
this._storeState = null;
|
|
498
621
|
this._routerState = null;
|
|
@@ -502,7 +625,8 @@ RouterState.ctorParameters = () => [
|
|
|
502
625
|
{ type: Store },
|
|
503
626
|
{ type: Router },
|
|
504
627
|
{ type: RouterStateSerializer },
|
|
505
|
-
{ type: NgZone }
|
|
628
|
+
{ type: NgZone },
|
|
629
|
+
{ type: Injector }
|
|
506
630
|
];
|
|
507
631
|
RouterState.decorators = [
|
|
508
632
|
{ type: Injectable }
|
|
@@ -512,7 +636,8 @@ RouterState.ctorParameters = () => [
|
|
|
512
636
|
{ type: Store },
|
|
513
637
|
{ type: Router },
|
|
514
638
|
{ type: RouterStateSerializer },
|
|
515
|
-
{ type: NgZone }
|
|
639
|
+
{ type: NgZone },
|
|
640
|
+
{ type: Injector }
|
|
516
641
|
];
|
|
517
642
|
__decorate([
|
|
518
643
|
Action(Navigate),
|
|
@@ -521,7 +646,14 @@ __decorate([
|
|
|
521
646
|
__metadata("design:returntype", void 0)
|
|
522
647
|
], RouterState.prototype, "navigate", null);
|
|
523
648
|
__decorate([
|
|
524
|
-
Action([
|
|
649
|
+
Action([
|
|
650
|
+
RouterRequest,
|
|
651
|
+
RouterNavigation,
|
|
652
|
+
RouterError,
|
|
653
|
+
RouterCancel,
|
|
654
|
+
RouterDataResolved,
|
|
655
|
+
RouterNavigated
|
|
656
|
+
]),
|
|
525
657
|
__metadata("design:type", Function),
|
|
526
658
|
__metadata("design:paramtypes", [Object, Object]),
|
|
527
659
|
__metadata("design:returntype", void 0)
|
|
@@ -550,7 +682,8 @@ RouterState = RouterState_1 = __decorate([
|
|
|
550
682
|
__metadata("design:paramtypes", [Store,
|
|
551
683
|
Router,
|
|
552
684
|
RouterStateSerializer,
|
|
553
|
-
NgZone
|
|
685
|
+
NgZone,
|
|
686
|
+
Injector])
|
|
554
687
|
], RouterState);
|
|
555
688
|
if (false) {
|
|
556
689
|
/**
|
|
@@ -576,12 +709,17 @@ if (false) {
|
|
|
576
709
|
* @type {?}
|
|
577
710
|
* @private
|
|
578
711
|
*/
|
|
579
|
-
RouterState.prototype.
|
|
712
|
+
RouterState.prototype._lastEvent;
|
|
580
713
|
/**
|
|
581
714
|
* @type {?}
|
|
582
715
|
* @private
|
|
583
716
|
*/
|
|
584
717
|
RouterState.prototype._subscription;
|
|
718
|
+
/**
|
|
719
|
+
* @type {?}
|
|
720
|
+
* @private
|
|
721
|
+
*/
|
|
722
|
+
RouterState.prototype._options;
|
|
585
723
|
/**
|
|
586
724
|
* @type {?}
|
|
587
725
|
* @private
|
|
@@ -610,12 +748,21 @@ if (false) {
|
|
|
610
748
|
*/
|
|
611
749
|
class NgxsRouterPluginModule {
|
|
612
750
|
/**
|
|
751
|
+
* @param {?=} options
|
|
613
752
|
* @return {?}
|
|
614
753
|
*/
|
|
615
|
-
static forRoot() {
|
|
754
|
+
static forRoot(options) {
|
|
616
755
|
return {
|
|
617
756
|
ngModule: NgxsRouterPluginModule,
|
|
618
|
-
providers: [
|
|
757
|
+
providers: [
|
|
758
|
+
{ provide: USER_OPTIONS, useValue: options },
|
|
759
|
+
{
|
|
760
|
+
provide: NGXS_ROUTER_PLUGIN_OPTIONS,
|
|
761
|
+
useFactory: createRouterPluginOptions,
|
|
762
|
+
deps: [USER_OPTIONS]
|
|
763
|
+
},
|
|
764
|
+
{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
|
|
765
|
+
]
|
|
619
766
|
};
|
|
620
767
|
}
|
|
621
768
|
}
|
|
@@ -640,5 +787,5 @@ NgxsRouterPluginModule.decorators = [
|
|
|
640
787
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
641
788
|
*/
|
|
642
789
|
|
|
643
|
-
export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigation, RouterState, RouterStateSerializer };
|
|
790
|
+
export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigated, RouterNavigation, RouterRequest, RouterState, RouterStateSerializer, USER_OPTIONS as ɵb, NGXS_ROUTER_PLUGIN_OPTIONS as ɵc, createRouterPluginOptions as ɵd };
|
|
644
791
|
//# sourceMappingURL=ngxs-router-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngxs-router-plugin.js","sources":["ng://@ngxs/router-plugin/src/router.actions.ts","ng://@ngxs/router-plugin/src/serializer.ts","ng://@ngxs/router-plugin/src/router.state.ts","ng://@ngxs/router-plugin/src/router.module.ts"],"sourcesContent":["import {\n NavigationCancel,\n NavigationError,\n NavigationExtras,\n Params,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd\n} from '@angular/router';\n\nimport { RouterTrigger } from './router.state';\n\n/**\n * Public event api of the router\n */\nexport class Navigate {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] Navigate';\n }\n constructor(\n public path: any[],\n public queryParams?: Params,\n public extras?: NavigationExtras\n ) {}\n}\n\n/**\n *\n * Angular Routers internal state events\n *\n */\n\n/**\n * An action dispatched when the router navigates.\n */\nexport class RouterNavigation<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterNavigation';\n }\n constructor(\n public routerState: T,\n public event: RoutesRecognized,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router cancel navigation.\n */\nexport class RouterCancel<T, V = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterCancel';\n }\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationCancel,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router errors.\n */\nexport class RouterError<T, V = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterError';\n }\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationError,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the `ResolveEnd` event is triggered.\n */\nexport class RouterDataResolved<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterDataResolved';\n }\n constructor(\n public routerState: T,\n public event: ResolveEnd,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An union type of router actions.\n */\nexport type RouterAction<T, V = RouterStateSnapshot> =\n | RouterNavigation<V>\n | RouterCancel<T, V>\n | RouterError<T, V>\n | RouterDataResolved<V>;\n","import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\n\nexport abstract class RouterStateSerializer<T> {\n abstract serialize(routerState: RouterStateSnapshot): T;\n}\n\nexport interface SerializedRouterStateSnapshot {\n root: ActivatedRouteSnapshot;\n url: string;\n}\n\nexport class DefaultRouterStateSerializer\n implements RouterStateSerializer<SerializedRouterStateSnapshot> {\n serialize(routerState: RouterStateSnapshot): SerializedRouterStateSnapshot {\n return {\n root: this.serializeRoute(routerState.root),\n url: routerState.url\n };\n }\n\n private serializeRoute(route: ActivatedRouteSnapshot): ActivatedRouteSnapshot {\n const children = route.children.map(c => this.serializeRoute(c));\n return {\n url: route.url,\n params: route.params,\n queryParams: route.queryParams,\n fragment: route.fragment,\n data: route.data,\n outlet: route.outlet,\n component: null,\n routeConfig: null,\n root: null as any,\n parent: null,\n firstChild: children[0],\n children: children,\n pathFromRoot: null as any,\n paramMap: route.paramMap,\n queryParamMap: route.queryParamMap,\n toString: route.toString\n };\n }\n}\n","import { NgZone, Injectable, OnDestroy } from '@angular/core';\nimport {\n NavigationCancel,\n NavigationError,\n Router,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd,\n NavigationStart,\n NavigationEnd\n} from '@angular/router';\nimport { Action, Selector, State, StateContext, Store } from '@ngxs/store';\nimport { Subscription } from 'rxjs';\n\nimport {\n Navigate,\n RouterAction,\n RouterCancel,\n RouterError,\n RouterNavigation,\n RouterDataResolved\n} from './router.actions';\nimport { RouterStateSerializer } from './serializer';\n\nexport interface RouterStateModel<T = RouterStateSnapshot> {\n state?: T;\n navigationId?: number;\n trigger: RouterTrigger;\n}\n\nexport type RouterTrigger =\n | 'none'\n | 'router'\n | 'store'\n // The `devtools` trigger means that the state change has been triggered by Redux DevTools (e.g. when the time-traveling is used).\n | 'devtools';\n\n@State<RouterStateModel>({\n name: 'router',\n defaults: {\n state: undefined,\n navigationId: undefined,\n trigger: 'none'\n }\n})\n@Injectable()\nexport class RouterState implements OnDestroy {\n /**\n * Determines how navigation was performed by the `RouterState` itself\n * or outside via `new Navigate(...)`\n */\n private _trigger: RouterTrigger = 'none';\n\n /**\n * That's the serialized state from the `Router` class\n */\n private _routerState: RouterStateSnapshot | null = null;\n\n /**\n * That's the value of the `RouterState` state\n */\n private _storeState: RouterStateModel | null = null;\n\n private _lastRoutesRecognized: RoutesRecognized = null!;\n\n private _subscription = new Subscription();\n\n @Selector()\n static state<T = RouterStateSnapshot>(state: RouterStateModel<T>) {\n return state && state.state;\n }\n\n @Selector()\n static url(state: RouterStateModel): string | undefined {\n return state && state.state && state.state.url;\n }\n\n constructor(\n private _store: Store,\n private _router: Router,\n private _serializer: RouterStateSerializer<RouterStateSnapshot>,\n private _ngZone: NgZone\n ) {\n this.setUpStoreListener();\n this.setUpRouterEventsListener();\n }\n\n ngOnDestroy(): void {\n this._subscription.unsubscribe();\n }\n\n @Action(Navigate)\n navigate(_: StateContext<RouterStateModel>, action: Navigate) {\n return this._ngZone.run(() =>\n this._router.navigate(action.path, {\n queryParams: action.queryParams,\n ...action.extras\n })\n );\n }\n\n @Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved])\n angularRouterAction(\n ctx: StateContext<RouterStateModel>,\n action: RouterAction<RouterStateModel, RouterStateSnapshot>\n ): void {\n ctx.setState({\n ...ctx.getState(),\n trigger: action.trigger,\n state: action.routerState,\n navigationId: action.event.id\n });\n }\n\n private setUpStoreListener(): void {\n const subscription = this._store\n .select(RouterState)\n .subscribe((state: RouterStateModel | undefined) => {\n this.navigateIfNeeded(state);\n });\n\n this._subscription.add(subscription);\n }\n\n private setUpRouterEventsListener(): void {\n const subscription = this._router.events.subscribe(event => {\n if (event instanceof NavigationStart) {\n this.navigationStart();\n } else if (event instanceof RoutesRecognized) {\n this._lastRoutesRecognized = event;\n } else if (event instanceof ResolveEnd) {\n this.dispatchRouterDataResolved(event);\n } else if (event instanceof NavigationCancel) {\n this.dispatchRouterCancel(event);\n this.reset();\n } else if (event instanceof NavigationError) {\n this.dispatchRouterError(event);\n this.reset();\n } else if (event instanceof NavigationEnd) {\n this.navigationEnd();\n this.reset();\n }\n });\n\n this._subscription.add(subscription);\n }\n\n private navigationStart(): void {\n this._routerState = this._serializer.serialize(this._router.routerState.snapshot);\n\n if (this._trigger !== 'none') {\n this._storeState = this._store.selectSnapshot(RouterState);\n }\n }\n\n private navigationEnd(): void {\n if (this.shouldDispatchRouterNavigation()) {\n this.dispatchRouterNavigation();\n }\n }\n\n private shouldDispatchRouterNavigation(): boolean {\n if (!this._storeState) return true;\n return this._trigger !== 'store';\n }\n\n private navigateIfNeeded(state: RouterStateModel | undefined): void {\n if (state && state.trigger === 'devtools') {\n this._storeState = this._store.selectSnapshot(RouterState);\n }\n\n const canSkipNavigation =\n !this._storeState ||\n !this._storeState.state ||\n !state ||\n state.trigger === 'router' ||\n this._router.url === this._storeState.state.url;\n\n if (canSkipNavigation) {\n return;\n }\n\n this._trigger = 'store';\n this._ngZone.run(() => {\n this._router.navigateByUrl(this._storeState!.state!.url);\n });\n }\n\n private dispatchRouterNavigation(): void {\n const nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);\n\n this.dispatchRouterAction(\n new RouterNavigation(\n nextRouterState,\n new RoutesRecognized(\n this._lastRoutesRecognized.id,\n this._lastRoutesRecognized.url,\n this._lastRoutesRecognized.urlAfterRedirects,\n nextRouterState\n ),\n this._trigger\n )\n );\n }\n\n private dispatchRouterCancel(event: NavigationCancel): void {\n this.dispatchRouterAction(\n new RouterCancel(this._routerState!, this._storeState, event, this._trigger)\n );\n }\n\n private dispatchRouterError(event: NavigationError): void {\n this.dispatchRouterAction(\n new RouterError(\n this._routerState!,\n this._storeState,\n new NavigationError(event.id, event.url, `${event}`),\n this._trigger\n )\n );\n }\n\n private dispatchRouterAction<T>(action: RouterAction<T>): void {\n this._trigger = 'router';\n\n try {\n this._store.dispatch(action);\n } finally {\n this._trigger = 'none';\n }\n }\n\n private dispatchRouterDataResolved(event: ResolveEnd): void {\n const routerState = this._serializer.serialize(event.state);\n this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));\n }\n\n private reset(): void {\n this._trigger = 'none';\n this._storeState = null;\n this._routerState = null;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgxsModule } from '@ngxs/store';\n\nimport { RouterState } from './router.state';\nimport { DefaultRouterStateSerializer, RouterStateSerializer } from './serializer';\n\n@NgModule({\n imports: [NgxsModule.forFeature([RouterState])]\n})\nexport class NgxsRouterPluginModule {\n static forRoot(): ModuleWithProviders<NgxsRouterPluginModule> {\n return {\n ngModule: NgxsRouterPluginModule,\n providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]\n };\n }\n}\n"],"names":["tslib_1.__decorate"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,QAAQ;;;;;;IAKnB,YACS,IAAW,EACX,WAAoB,EACpB,MAAyB;QAFzB,SAAI,GAAJ,IAAI,CAAO;QACX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C,WAAW,CAAC,CAAC,CAAC;aAChD;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngxs-router-plugin.js","sources":["ng://@ngxs/router-plugin/src/router.actions.ts","ng://@ngxs/router-plugin/src/serializer.ts","ng://@ngxs/router-plugin/src/symbols.ts","ng://@ngxs/router-plugin/src/router.state.ts","ng://@ngxs/router-plugin/src/router.module.ts"],"sourcesContent":["import {\n NavigationCancel,\n NavigationError,\n NavigationExtras,\n Params,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd,\n NavigationStart,\n NavigationEnd\n} from '@angular/router';\n\nimport { RouterTrigger } from './router.state';\n\n/**\n * Public event api of the router\n */\nexport class Navigate {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] Navigate';\n }\n constructor(\n public path: any[],\n public queryParams?: Params,\n public extras?: NavigationExtras\n ) {}\n}\n\n/**\n *\n * Angular Routers internal state events\n *\n */\n\n/**\n * An action dispatched when the router starts the navigation.\n */\nexport class RouterRequest<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterRequest';\n }\n constructor(\n public routerState: T,\n public event: NavigationStart,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router navigates.\n */\nexport class RouterNavigation<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterNavigation';\n }\n constructor(\n public routerState: T,\n public event: RoutesRecognized,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router cancel navigation.\n */\nexport class RouterCancel<T, V = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterCancel';\n }\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationCancel,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router errors.\n */\nexport class RouterError<T, V = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterError';\n }\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationError,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the `ResolveEnd` event is triggered.\n */\nexport class RouterDataResolved<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterDataResolved';\n }\n constructor(\n public routerState: T,\n public event: ResolveEnd,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router navigation has been finished successfully.\n */\nexport class RouterNavigated<T = RouterStateSnapshot> {\n static get type() {\n // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138\n return '[Router] RouterNavigated';\n }\n constructor(\n public routerState: T,\n public event: NavigationEnd,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An union type of router actions.\n */\nexport type RouterAction<T, V = RouterStateSnapshot> =\n | RouterRequest<V>\n | RouterNavigation<V>\n | RouterCancel<T, V>\n | RouterError<T, V>\n | RouterDataResolved<V>\n | RouterNavigated<V>;\n","import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\n\nexport abstract class RouterStateSerializer<T> {\n abstract serialize(routerState: RouterStateSnapshot): T;\n}\n\nexport interface SerializedRouterStateSnapshot {\n root: ActivatedRouteSnapshot;\n url: string;\n}\n\nexport class DefaultRouterStateSerializer\n implements RouterStateSerializer<SerializedRouterStateSnapshot> {\n serialize(routerState: RouterStateSnapshot): SerializedRouterStateSnapshot {\n return {\n root: this.serializeRoute(routerState.root),\n url: routerState.url\n };\n }\n\n private serializeRoute(route: ActivatedRouteSnapshot): ActivatedRouteSnapshot {\n const children = route.children.map(c => this.serializeRoute(c));\n return {\n url: route.url,\n params: route.params,\n queryParams: route.queryParams,\n fragment: route.fragment,\n data: route.data,\n outlet: route.outlet,\n component: null,\n routeConfig: null,\n root: null as any,\n parent: null,\n firstChild: children[0],\n children: children,\n pathFromRoot: null as any,\n paramMap: route.paramMap,\n queryParamMap: route.queryParamMap,\n toString: route.toString\n };\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const enum NavigationActionTiming {\n PreActivation = 1,\n PostActivation = 2\n}\n\nexport interface NgxsRouterPluginOptions {\n navigationActionTiming?: NavigationActionTiming;\n}\n\nexport const USER_OPTIONS = new InjectionToken<NgxsRouterPluginOptions | undefined>(\n 'USER_OPTIONS',\n { providedIn: 'root', factory: () => undefined }\n);\n\nexport const NGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken<NgxsRouterPluginOptions>(\n 'NGXS_ROUTER_PLUGIN_OPTIONS',\n { providedIn: 'root', factory: () => ({}) }\n);\n\nexport function createRouterPluginOptions(\n options: NgxsRouterPluginOptions | undefined\n): NgxsRouterPluginOptions {\n return {\n navigationActionTiming:\n (options && options.navigationActionTiming) || NavigationActionTiming.PreActivation\n };\n}\n","import { NgZone, Injectable, OnDestroy, Injector } from '@angular/core';\nimport {\n NavigationCancel,\n NavigationError,\n Router,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd,\n NavigationStart,\n NavigationEnd,\n Event\n} from '@angular/router';\nimport { Action, Selector, State, StateContext, Store } from '@ngxs/store';\nimport { Subscription } from 'rxjs';\n\nimport {\n Navigate,\n RouterAction,\n RouterCancel,\n RouterError,\n RouterNavigation,\n RouterDataResolved,\n RouterRequest,\n RouterNavigated\n} from './router.actions';\nimport { RouterStateSerializer } from './serializer';\nimport {\n NavigationActionTiming,\n NgxsRouterPluginOptions,\n NGXS_ROUTER_PLUGIN_OPTIONS\n} from './symbols';\n\nexport interface RouterStateModel<T = RouterStateSnapshot> {\n state?: T;\n navigationId?: number;\n trigger: RouterTrigger;\n}\n\nexport type RouterTrigger =\n | 'none'\n | 'router'\n | 'store'\n // The `devtools` trigger means that the state change has been triggered by Redux DevTools (e.g. when the time-traveling is used).\n | 'devtools';\n\n@State<RouterStateModel>({\n name: 'router',\n defaults: {\n state: undefined,\n navigationId: undefined,\n trigger: 'none'\n }\n})\n@Injectable()\nexport class RouterState implements OnDestroy {\n /**\n * Determines how navigation was performed by the `RouterState` itself\n * or outside via `new Navigate(...)`\n */\n private _trigger: RouterTrigger = 'none';\n\n /**\n * That's the serialized state from the `Router` class\n */\n private _routerState: RouterStateSnapshot | null = null;\n\n /**\n * That's the value of the `RouterState` state\n */\n private _storeState: RouterStateModel | null = null;\n\n private _lastEvent: Event | null = null;\n\n private _subscription = new Subscription();\n\n private _options: NgxsRouterPluginOptions | null = null;\n\n @Selector()\n static state<T = RouterStateSnapshot>(state: RouterStateModel<T>) {\n return state && state.state;\n }\n\n @Selector()\n static url(state: RouterStateModel): string | undefined {\n return state && state.state && state.state.url;\n }\n\n constructor(\n private _store: Store,\n private _router: Router,\n private _serializer: RouterStateSerializer<RouterStateSnapshot>,\n private _ngZone: NgZone,\n injector: Injector\n ) {\n // Note: do not use `@Inject` since it fails on lower versions of Angular with Jest\n // integration, it cannot resolve the token provider.\n this._options = injector.get(NGXS_ROUTER_PLUGIN_OPTIONS, null);\n this._setUpStoreListener();\n this._setUpRouterEventsListener();\n }\n\n ngOnDestroy(): void {\n this._subscription.unsubscribe();\n }\n\n @Action(Navigate)\n navigate(_: StateContext<RouterStateModel>, action: Navigate) {\n return this._ngZone.run(() =>\n this._router.navigate(action.path, {\n queryParams: action.queryParams,\n ...action.extras\n })\n );\n }\n\n @Action([\n RouterRequest,\n RouterNavigation,\n RouterError,\n RouterCancel,\n RouterDataResolved,\n RouterNavigated\n ])\n angularRouterAction(\n ctx: StateContext<RouterStateModel>,\n action: RouterAction<RouterStateModel, RouterStateSnapshot>\n ): void {\n ctx.setState({\n trigger: action.trigger,\n state: action.routerState,\n navigationId: action.event.id\n });\n }\n\n private _setUpStoreListener(): void {\n const subscription = this._store\n .select(RouterState)\n .subscribe((state: RouterStateModel | undefined) => {\n this._navigateIfNeeded(state);\n });\n\n this._subscription.add(subscription);\n }\n\n private _navigateIfNeeded(routerState: RouterStateModel | undefined): void {\n if (routerState && routerState.trigger === 'devtools') {\n this._storeState = this._store.selectSnapshot(RouterState);\n }\n\n const canSkipNavigation =\n !this._storeState ||\n !this._storeState.state ||\n !routerState ||\n routerState.trigger === 'router' ||\n this._router.url === this._storeState.state.url ||\n this._lastEvent instanceof NavigationStart;\n\n if (canSkipNavigation) {\n return;\n }\n\n this._storeState = this._store.selectSnapshot(RouterState);\n this._trigger = 'store';\n this._ngZone.run(() => this._router.navigateByUrl(this._storeState!.state!.url));\n }\n\n private _setUpRouterEventsListener(): void {\n const dispatchRouterNavigationLate =\n this._options != null &&\n this._options.navigationActionTiming === NavigationActionTiming.PostActivation;\n\n let lastRoutesRecognized: RoutesRecognized;\n\n const subscription = this._router.events.subscribe(event => {\n this._lastEvent = event;\n\n if (event instanceof NavigationStart) {\n this._navigationStart(event);\n } else if (event instanceof RoutesRecognized) {\n lastRoutesRecognized = event;\n if (!dispatchRouterNavigationLate && this._trigger !== 'store') {\n this._dispatchRouterNavigation(lastRoutesRecognized);\n }\n } else if (event instanceof ResolveEnd) {\n this._dispatchRouterDataResolved(event);\n } else if (event instanceof NavigationCancel) {\n this._dispatchRouterCancel(event);\n this._reset();\n } else if (event instanceof NavigationError) {\n this._dispatchRouterError(event);\n this._reset();\n } else if (event instanceof NavigationEnd) {\n if (this._trigger !== 'store') {\n if (dispatchRouterNavigationLate) {\n this._dispatchRouterNavigation(lastRoutesRecognized);\n }\n this._dispatchRouterNavigated(event);\n }\n this._reset();\n }\n });\n\n this._subscription.add(subscription);\n }\n\n /** Reacts to `NavigationStart`. */\n private _navigationStart(event: NavigationStart): void {\n this._routerState = this._serializer.serialize(this._router.routerState.snapshot);\n\n if (this._trigger !== 'none') {\n this._storeState = this._store.selectSnapshot(RouterState);\n this._dispatchRouterAction(new RouterRequest(this._routerState, event, this._trigger));\n }\n }\n\n /** Reacts to `ResolveEnd`. */\n private _dispatchRouterDataResolved(event: ResolveEnd): void {\n const routerState = this._serializer.serialize(event.state);\n this._dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));\n }\n\n /** Reacts to `RoutesRecognized` or `NavigationEnd`, depends on the `navigationActionTiming`. */\n private _dispatchRouterNavigation(lastRoutesRecognized: RoutesRecognized): void {\n const nextRouterState = this._serializer.serialize(lastRoutesRecognized.state);\n\n this._dispatchRouterAction(\n new RouterNavigation(\n nextRouterState,\n new RoutesRecognized(\n lastRoutesRecognized.id,\n lastRoutesRecognized.url,\n lastRoutesRecognized.urlAfterRedirects,\n nextRouterState\n ),\n this._trigger\n )\n );\n }\n\n /** Reacts to `NavigationCancel`. */\n private _dispatchRouterCancel(event: NavigationCancel): void {\n this._dispatchRouterAction(\n new RouterCancel(this._routerState!, this._storeState, event, this._trigger)\n );\n }\n\n /** Reacts to `NavigationEnd`. */\n private _dispatchRouterError(event: NavigationError): void {\n this._dispatchRouterAction(\n new RouterError(\n this._routerState!,\n this._storeState,\n new NavigationError(event.id, event.url, `${event}`),\n this._trigger\n )\n );\n }\n\n /** Reacts to `NavigationEnd`. */\n private _dispatchRouterNavigated(event: NavigationEnd): void {\n const routerState = this._serializer.serialize(this._router.routerState.snapshot);\n this._dispatchRouterAction(new RouterNavigated(routerState, event, this._trigger));\n }\n\n private _dispatchRouterAction<T>(action: RouterAction<T>): void {\n this._trigger = 'router';\n\n try {\n this._store.dispatch(action);\n } finally {\n this._trigger = 'none';\n }\n }\n\n private _reset(): void {\n this._trigger = 'none';\n this._storeState = null;\n this._routerState = null;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgxsModule } from '@ngxs/store';\n\nimport { RouterState } from './router.state';\nimport { DefaultRouterStateSerializer, RouterStateSerializer } from './serializer';\nimport {\n USER_OPTIONS,\n NGXS_ROUTER_PLUGIN_OPTIONS,\n NgxsRouterPluginOptions,\n createRouterPluginOptions\n} from './symbols';\n\n@NgModule({\n imports: [NgxsModule.forFeature([RouterState])]\n})\nexport class NgxsRouterPluginModule {\n static forRoot(\n options?: NgxsRouterPluginOptions\n ): ModuleWithProviders<NgxsRouterPluginModule> {\n return {\n ngModule: NgxsRouterPluginModule,\n providers: [\n { provide: USER_OPTIONS, useValue: options },\n {\n provide: NGXS_ROUTER_PLUGIN_OPTIONS,\n useFactory: createRouterPluginOptions,\n deps: [USER_OPTIONS]\n },\n { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }\n ]\n };\n }\n}\n"],"names":["tslib_1.__decorate"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,QAAQ;;;;;;IAKnB,YACS,IAAW,EACX,WAAoB,EACpB,MAAyB;QAFzB,SAAI,GAAJ,IAAI,CAAO;QACX,gBAAW,GAAX,WAAW,CAAS;QACpB,WAAM,GAAN,MAAM,CAAmB;KAC9B;;;;IARJ,WAAW,IAAI;;QAEb,OAAO,mBAAmB,CAAC;KAC5B;CAMF;;;IAJG,wBAAkB;;IAClB,+BAA2B;;IAC3B,0BAAgC;;;;;;;;;;;AAapC,MAAa,aAAa;;;;;;IAKxB,YACS,WAAc,EACd,KAAsB,EACtB,UAAyB,MAAM;QAF/B,gBAAW,GAAX,WAAW,CAAG;QACd,UAAK,GAAL,KAAK,CAAiB;QACtB,YAAO,GAAP,OAAO,CAAwB;KACpC;;;;IARJ,WAAW,IAAI;;QAEb,OAAO,wBAAwB,CAAC;KACjC;CAMF;;;IAJG,oCAAqB;;IACrB,8BAA6B;;IAC7B,gCAAsC;;;;;;AAO1C,MAAa,gBAAgB;;;;;;IAK3B,YACS,WAAc,EACd,KAAuB,EACvB,UAAyB,MAAM;QAF/B,gBAAW,GAAX,WAAW,CAAG;QACd,UAAK,GAAL,KAA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