@ngrx/store-devtools 11.0.0-rc.0 → 11.1.1
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/ngrx-store-devtools.umd.js +44 -789
- package/bundles/ngrx-store-devtools.umd.js.map +1 -1
- package/bundles/ngrx-store-devtools.umd.min.js +2 -2
- package/bundles/ngrx-store-devtools.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -7
- package/esm2015/ngrx-store-devtools.js +2 -7
- package/esm2015/public_api.js +2 -7
- package/esm2015/src/actions.js +1 -135
- package/esm2015/src/config.js +1 -80
- package/esm2015/src/devtools-dispatcher.js +1 -6
- package/esm2015/src/devtools.js +9 -123
- package/esm2015/src/extension.js +14 -216
- package/esm2015/src/index.js +1 -6
- package/esm2015/src/instrument.js +3 -26
- package/esm2015/src/reducer.js +8 -146
- package/esm2015/src/utils.js +10 -92
- package/fesm2015/ngrx-store-devtools.js +43 -834
- package/fesm2015/ngrx-store-devtools.js.map +1 -1
- package/package.json +3 -3
- package/schematics-core/index.js +4 -1
- package/schematics-core/index.js.map +1 -1
- package/schematics-core/utility/ast-utils.js +127 -1
- package/schematics-core/utility/ast-utils.js.map +1 -1
- package/schematics-core/utility/config.js +1 -1
- package/schematics-core/utility/config.js.map +1 -1
- package/schematics-core/utility/find-component.js +101 -0
- package/schematics-core/utility/find-component.js.map +1 -0
- package/schematics-core/utility/libs-version.js +1 -1
- package/schematics-core/utility/libs-version.js.map +1 -1
- package/schematics-core/utility/project.js +4 -2
- package/schematics-core/utility/project.js.map +1 -1
- package/CHANGELOG.md +0 -3
- package/esm2015/index.ngsummary.json +0 -1
- package/esm2015/ngrx-store-devtools.ngsummary.json +0 -1
- package/esm2015/public_api.ngsummary.json +0 -1
- package/esm2015/src/actions.ngsummary.json +0 -1
- package/esm2015/src/config.ngsummary.json +0 -1
- package/esm2015/src/devtools-dispatcher.ngsummary.json +0 -1
- package/esm2015/src/devtools.ngsummary.json +0 -1
- package/esm2015/src/extension.ngsummary.json +0 -1
- package/esm2015/src/index.ngsummary.json +0 -1
- package/esm2015/src/instrument.ngfactory.js +0 -11
- package/esm2015/src/instrument.ngsummary.json +0 -1
- package/esm2015/src/reducer.ngsummary.json +0 -1
- package/esm2015/src/utils.ngsummary.json +0 -1
- package/src/instrument.ngfactory.d.ts +0 -3
|
@@ -1,88 +1,22 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngrx/store'), require('rxjs'), require('rxjs/operators')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@ngrx/store-devtools', ['exports', '@angular/core', '@ngrx/store', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = global || self, factory((global.ngrx = global.ngrx || {}, global.ngrx['store-devtools'] = {}), global.ng.core, global.ngrx.store, global.rxjs, global.rxjs.operators));
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngrx = global.ngrx || {}, global.ngrx['store-devtools'] = {}), global.ng.core, global.ngrx.store, global.rxjs, global.rxjs.operators));
|
|
5
5
|
}(this, (function (exports, core, store, rxjs, operators) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview added by tsickle
|
|
9
|
-
* Generated from: src/config.ts
|
|
10
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @record
|
|
14
|
-
*/
|
|
15
|
-
function DevToolsFeatureOptions() { }
|
|
16
|
-
if (false) {
|
|
17
|
-
/** @type {?|undefined} */
|
|
18
|
-
DevToolsFeatureOptions.prototype.pause;
|
|
19
|
-
/** @type {?|undefined} */
|
|
20
|
-
DevToolsFeatureOptions.prototype.lock;
|
|
21
|
-
/** @type {?|undefined} */
|
|
22
|
-
DevToolsFeatureOptions.prototype.persist;
|
|
23
|
-
/** @type {?|undefined} */
|
|
24
|
-
DevToolsFeatureOptions.prototype.export;
|
|
25
|
-
/** @type {?|undefined} */
|
|
26
|
-
DevToolsFeatureOptions.prototype.import;
|
|
27
|
-
/** @type {?|undefined} */
|
|
28
|
-
DevToolsFeatureOptions.prototype.jump;
|
|
29
|
-
/** @type {?|undefined} */
|
|
30
|
-
DevToolsFeatureOptions.prototype.skip;
|
|
31
|
-
/** @type {?|undefined} */
|
|
32
|
-
DevToolsFeatureOptions.prototype.reorder;
|
|
33
|
-
/** @type {?|undefined} */
|
|
34
|
-
DevToolsFeatureOptions.prototype.dispatch;
|
|
35
|
-
/** @type {?|undefined} */
|
|
36
|
-
DevToolsFeatureOptions.prototype.test;
|
|
37
|
-
}
|
|
38
7
|
var StoreDevtoolsConfig = /** @class */ (function () {
|
|
39
8
|
function StoreDevtoolsConfig() {
|
|
40
9
|
this.maxAge = false;
|
|
41
10
|
}
|
|
42
11
|
return StoreDevtoolsConfig;
|
|
43
12
|
}());
|
|
44
|
-
if (false) {
|
|
45
|
-
/** @type {?} */
|
|
46
|
-
StoreDevtoolsConfig.prototype.maxAge;
|
|
47
|
-
/** @type {?} */
|
|
48
|
-
StoreDevtoolsConfig.prototype.monitor;
|
|
49
|
-
/** @type {?} */
|
|
50
|
-
StoreDevtoolsConfig.prototype.actionSanitizer;
|
|
51
|
-
/** @type {?} */
|
|
52
|
-
StoreDevtoolsConfig.prototype.stateSanitizer;
|
|
53
|
-
/** @type {?} */
|
|
54
|
-
StoreDevtoolsConfig.prototype.name;
|
|
55
|
-
/** @type {?} */
|
|
56
|
-
StoreDevtoolsConfig.prototype.serialize;
|
|
57
|
-
/** @type {?} */
|
|
58
|
-
StoreDevtoolsConfig.prototype.logOnly;
|
|
59
|
-
/** @type {?} */
|
|
60
|
-
StoreDevtoolsConfig.prototype.features;
|
|
61
|
-
/** @type {?} */
|
|
62
|
-
StoreDevtoolsConfig.prototype.actionsBlocklist;
|
|
63
|
-
/** @type {?} */
|
|
64
|
-
StoreDevtoolsConfig.prototype.actionsSafelist;
|
|
65
|
-
/** @type {?} */
|
|
66
|
-
StoreDevtoolsConfig.prototype.predicate;
|
|
67
|
-
}
|
|
68
|
-
/** @type {?} */
|
|
69
13
|
var STORE_DEVTOOLS_CONFIG = new core.InjectionToken('@ngrx/store-devtools Options');
|
|
70
|
-
/** @type {?} */
|
|
71
14
|
var INITIAL_OPTIONS = new core.InjectionToken('@ngrx/store-devtools Initial Config');
|
|
72
|
-
/**
|
|
73
|
-
* @return {?}
|
|
74
|
-
*/
|
|
75
15
|
function noMonitor() {
|
|
76
16
|
return null;
|
|
77
17
|
}
|
|
78
|
-
/** @type {?} */
|
|
79
18
|
var DEFAULT_NAME = 'NgRx Store DevTools';
|
|
80
|
-
/**
|
|
81
|
-
* @param {?} _options
|
|
82
|
-
* @return {?}
|
|
83
|
-
*/
|
|
84
19
|
function createConfig(_options) {
|
|
85
|
-
/** @type {?} */
|
|
86
20
|
var DEFAULT_OPTIONS = {
|
|
87
21
|
maxAge: false,
|
|
88
22
|
monitor: noMonitor,
|
|
@@ -95,35 +29,22 @@
|
|
|
95
29
|
// options like "lock" which might otherwise not show up.
|
|
96
30
|
features: {
|
|
97
31
|
pause: true,
|
|
98
|
-
// start/pause recording of dispatched actions
|
|
99
32
|
lock: true,
|
|
100
|
-
// lock/unlock dispatching actions and side effects
|
|
101
33
|
persist: true,
|
|
102
|
-
// persist states on page reloading
|
|
103
34
|
export: true,
|
|
104
|
-
// export history of actions in a file
|
|
105
35
|
import: 'custom',
|
|
106
|
-
// import history of actions from a file
|
|
107
36
|
jump: true,
|
|
108
|
-
// jump back and forth (time travelling)
|
|
109
37
|
skip: true,
|
|
110
|
-
// skip (cancel) actions
|
|
111
38
|
reorder: true,
|
|
112
|
-
// drag and drop actions in the history list
|
|
113
39
|
dispatch: true,
|
|
114
|
-
// dispatch custom actions or action creators
|
|
115
40
|
test: true,
|
|
116
41
|
},
|
|
117
42
|
};
|
|
118
|
-
/** @type {?} */
|
|
119
43
|
var options = typeof _options === 'function' ? _options() : _options;
|
|
120
|
-
/** @type {?} */
|
|
121
44
|
var logOnly = options.logOnly
|
|
122
45
|
? { pause: true, export: true, test: true }
|
|
123
46
|
: false;
|
|
124
|
-
/** @type {?} */
|
|
125
47
|
var features = options.features || logOnly || DEFAULT_OPTIONS.features;
|
|
126
|
-
/** @type {?} */
|
|
127
48
|
var config = Object.assign({}, DEFAULT_OPTIONS, { features: features }, options);
|
|
128
49
|
if (config.maxAge && config.maxAge < 2) {
|
|
129
50
|
throw new Error("Devtools 'maxAge' cannot be less than 2, got " + config.maxAge);
|
|
@@ -432,42 +353,20 @@
|
|
|
432
353
|
return value;
|
|
433
354
|
}
|
|
434
355
|
|
|
435
|
-
/**
|
|
436
|
-
* @fileoverview added by tsickle
|
|
437
|
-
* Generated from: src/actions.ts
|
|
438
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
439
|
-
*/
|
|
440
|
-
/** @type {?} */
|
|
441
356
|
var PERFORM_ACTION = 'PERFORM_ACTION';
|
|
442
|
-
/** @type {?} */
|
|
443
357
|
var REFRESH = 'REFRESH';
|
|
444
|
-
/** @type {?} */
|
|
445
358
|
var RESET = 'RESET';
|
|
446
|
-
/** @type {?} */
|
|
447
359
|
var ROLLBACK = 'ROLLBACK';
|
|
448
|
-
/** @type {?} */
|
|
449
360
|
var COMMIT = 'COMMIT';
|
|
450
|
-
/** @type {?} */
|
|
451
361
|
var SWEEP = 'SWEEP';
|
|
452
|
-
/** @type {?} */
|
|
453
362
|
var TOGGLE_ACTION = 'TOGGLE_ACTION';
|
|
454
|
-
/** @type {?} */
|
|
455
363
|
var SET_ACTIONS_ACTIVE = 'SET_ACTIONS_ACTIVE';
|
|
456
|
-
/** @type {?} */
|
|
457
364
|
var JUMP_TO_STATE = 'JUMP_TO_STATE';
|
|
458
|
-
/** @type {?} */
|
|
459
365
|
var JUMP_TO_ACTION = 'JUMP_TO_ACTION';
|
|
460
|
-
/** @type {?} */
|
|
461
366
|
var IMPORT_STATE = 'IMPORT_STATE';
|
|
462
|
-
/** @type {?} */
|
|
463
367
|
var LOCK_CHANGES = 'LOCK_CHANGES';
|
|
464
|
-
/** @type {?} */
|
|
465
368
|
var PAUSE_RECORDING = 'PAUSE_RECORDING';
|
|
466
369
|
var PerformAction = /** @class */ (function () {
|
|
467
|
-
/**
|
|
468
|
-
* @param {?} action
|
|
469
|
-
* @param {?} timestamp
|
|
470
|
-
*/
|
|
471
370
|
function PerformAction(action, timestamp) {
|
|
472
371
|
this.action = action;
|
|
473
372
|
this.timestamp = timestamp;
|
|
@@ -479,104 +378,47 @@
|
|
|
479
378
|
}
|
|
480
379
|
return PerformAction;
|
|
481
380
|
}());
|
|
482
|
-
if (false) {
|
|
483
|
-
/** @type {?} */
|
|
484
|
-
PerformAction.prototype.type;
|
|
485
|
-
/** @type {?} */
|
|
486
|
-
PerformAction.prototype.action;
|
|
487
|
-
/** @type {?} */
|
|
488
|
-
PerformAction.prototype.timestamp;
|
|
489
|
-
}
|
|
490
381
|
var Refresh = /** @class */ (function () {
|
|
491
382
|
function Refresh() {
|
|
492
383
|
this.type = REFRESH;
|
|
493
384
|
}
|
|
494
385
|
return Refresh;
|
|
495
386
|
}());
|
|
496
|
-
if (false) {
|
|
497
|
-
/** @type {?} */
|
|
498
|
-
Refresh.prototype.type;
|
|
499
|
-
}
|
|
500
387
|
var Reset = /** @class */ (function () {
|
|
501
|
-
/**
|
|
502
|
-
* @param {?} timestamp
|
|
503
|
-
*/
|
|
504
388
|
function Reset(timestamp) {
|
|
505
389
|
this.timestamp = timestamp;
|
|
506
390
|
this.type = RESET;
|
|
507
391
|
}
|
|
508
392
|
return Reset;
|
|
509
393
|
}());
|
|
510
|
-
if (false) {
|
|
511
|
-
/** @type {?} */
|
|
512
|
-
Reset.prototype.type;
|
|
513
|
-
/** @type {?} */
|
|
514
|
-
Reset.prototype.timestamp;
|
|
515
|
-
}
|
|
516
394
|
var Rollback = /** @class */ (function () {
|
|
517
|
-
/**
|
|
518
|
-
* @param {?} timestamp
|
|
519
|
-
*/
|
|
520
395
|
function Rollback(timestamp) {
|
|
521
396
|
this.timestamp = timestamp;
|
|
522
397
|
this.type = ROLLBACK;
|
|
523
398
|
}
|
|
524
399
|
return Rollback;
|
|
525
400
|
}());
|
|
526
|
-
if (false) {
|
|
527
|
-
/** @type {?} */
|
|
528
|
-
Rollback.prototype.type;
|
|
529
|
-
/** @type {?} */
|
|
530
|
-
Rollback.prototype.timestamp;
|
|
531
|
-
}
|
|
532
401
|
var Commit = /** @class */ (function () {
|
|
533
|
-
/**
|
|
534
|
-
* @param {?} timestamp
|
|
535
|
-
*/
|
|
536
402
|
function Commit(timestamp) {
|
|
537
403
|
this.timestamp = timestamp;
|
|
538
404
|
this.type = COMMIT;
|
|
539
405
|
}
|
|
540
406
|
return Commit;
|
|
541
407
|
}());
|
|
542
|
-
if (false) {
|
|
543
|
-
/** @type {?} */
|
|
544
|
-
Commit.prototype.type;
|
|
545
|
-
/** @type {?} */
|
|
546
|
-
Commit.prototype.timestamp;
|
|
547
|
-
}
|
|
548
408
|
var Sweep = /** @class */ (function () {
|
|
549
409
|
function Sweep() {
|
|
550
410
|
this.type = SWEEP;
|
|
551
411
|
}
|
|
552
412
|
return Sweep;
|
|
553
413
|
}());
|
|
554
|
-
if (false) {
|
|
555
|
-
/** @type {?} */
|
|
556
|
-
Sweep.prototype.type;
|
|
557
|
-
}
|
|
558
414
|
var ToggleAction = /** @class */ (function () {
|
|
559
|
-
/**
|
|
560
|
-
* @param {?} id
|
|
561
|
-
*/
|
|
562
415
|
function ToggleAction(id) {
|
|
563
416
|
this.id = id;
|
|
564
417
|
this.type = TOGGLE_ACTION;
|
|
565
418
|
}
|
|
566
419
|
return ToggleAction;
|
|
567
420
|
}());
|
|
568
|
-
if (false) {
|
|
569
|
-
/** @type {?} */
|
|
570
|
-
ToggleAction.prototype.type;
|
|
571
|
-
/** @type {?} */
|
|
572
|
-
ToggleAction.prototype.id;
|
|
573
|
-
}
|
|
574
421
|
var SetActionsActive = /** @class */ (function () {
|
|
575
|
-
/**
|
|
576
|
-
* @param {?} start
|
|
577
|
-
* @param {?} end
|
|
578
|
-
* @param {?=} active
|
|
579
|
-
*/
|
|
580
422
|
function SetActionsActive(start, end, active) {
|
|
581
423
|
if (active === void 0) { active = true; }
|
|
582
424
|
this.start = start;
|
|
@@ -586,96 +428,41 @@
|
|
|
586
428
|
}
|
|
587
429
|
return SetActionsActive;
|
|
588
430
|
}());
|
|
589
|
-
if (false) {
|
|
590
|
-
/** @type {?} */
|
|
591
|
-
SetActionsActive.prototype.type;
|
|
592
|
-
/** @type {?} */
|
|
593
|
-
SetActionsActive.prototype.start;
|
|
594
|
-
/** @type {?} */
|
|
595
|
-
SetActionsActive.prototype.end;
|
|
596
|
-
/** @type {?} */
|
|
597
|
-
SetActionsActive.prototype.active;
|
|
598
|
-
}
|
|
599
431
|
var JumpToState = /** @class */ (function () {
|
|
600
|
-
/**
|
|
601
|
-
* @param {?} index
|
|
602
|
-
*/
|
|
603
432
|
function JumpToState(index) {
|
|
604
433
|
this.index = index;
|
|
605
434
|
this.type = JUMP_TO_STATE;
|
|
606
435
|
}
|
|
607
436
|
return JumpToState;
|
|
608
437
|
}());
|
|
609
|
-
if (false) {
|
|
610
|
-
/** @type {?} */
|
|
611
|
-
JumpToState.prototype.type;
|
|
612
|
-
/** @type {?} */
|
|
613
|
-
JumpToState.prototype.index;
|
|
614
|
-
}
|
|
615
438
|
var JumpToAction = /** @class */ (function () {
|
|
616
|
-
/**
|
|
617
|
-
* @param {?} actionId
|
|
618
|
-
*/
|
|
619
439
|
function JumpToAction(actionId) {
|
|
620
440
|
this.actionId = actionId;
|
|
621
441
|
this.type = JUMP_TO_ACTION;
|
|
622
442
|
}
|
|
623
443
|
return JumpToAction;
|
|
624
444
|
}());
|
|
625
|
-
if (false) {
|
|
626
|
-
/** @type {?} */
|
|
627
|
-
JumpToAction.prototype.type;
|
|
628
|
-
/** @type {?} */
|
|
629
|
-
JumpToAction.prototype.actionId;
|
|
630
|
-
}
|
|
631
445
|
var ImportState = /** @class */ (function () {
|
|
632
|
-
/**
|
|
633
|
-
* @param {?} nextLiftedState
|
|
634
|
-
*/
|
|
635
446
|
function ImportState(nextLiftedState) {
|
|
636
447
|
this.nextLiftedState = nextLiftedState;
|
|
637
448
|
this.type = IMPORT_STATE;
|
|
638
449
|
}
|
|
639
450
|
return ImportState;
|
|
640
451
|
}());
|
|
641
|
-
if (false) {
|
|
642
|
-
/** @type {?} */
|
|
643
|
-
ImportState.prototype.type;
|
|
644
|
-
/** @type {?} */
|
|
645
|
-
ImportState.prototype.nextLiftedState;
|
|
646
|
-
}
|
|
647
452
|
var LockChanges = /** @class */ (function () {
|
|
648
|
-
/**
|
|
649
|
-
* @param {?} status
|
|
650
|
-
*/
|
|
651
453
|
function LockChanges(status) {
|
|
652
454
|
this.status = status;
|
|
653
455
|
this.type = LOCK_CHANGES;
|
|
654
456
|
}
|
|
655
457
|
return LockChanges;
|
|
656
458
|
}());
|
|
657
|
-
if (false) {
|
|
658
|
-
/** @type {?} */
|
|
659
|
-
LockChanges.prototype.type;
|
|
660
|
-
/** @type {?} */
|
|
661
|
-
LockChanges.prototype.status;
|
|
662
|
-
}
|
|
663
459
|
var PauseRecording = /** @class */ (function () {
|
|
664
|
-
/**
|
|
665
|
-
* @param {?} status
|
|
666
|
-
*/
|
|
667
460
|
function PauseRecording(status) {
|
|
668
461
|
this.status = status;
|
|
669
462
|
this.type = PAUSE_RECORDING;
|
|
670
463
|
}
|
|
671
464
|
return PauseRecording;
|
|
672
465
|
}());
|
|
673
|
-
if (false) {
|
|
674
|
-
/** @type {?} */
|
|
675
|
-
PauseRecording.prototype.type;
|
|
676
|
-
/** @type {?} */
|
|
677
|
-
PauseRecording.prototype.status;
|
|
678
|
-
}
|
|
679
466
|
|
|
680
467
|
var DevtoolsDispatcher = /** @class */ (function (_super) {
|
|
681
468
|
__extends(DevtoolsDispatcher, _super);
|
|
@@ -688,26 +475,11 @@
|
|
|
688
475
|
{ type: core.Injectable }
|
|
689
476
|
];
|
|
690
477
|
|
|
691
|
-
/**
|
|
692
|
-
* @fileoverview added by tsickle
|
|
693
|
-
* Generated from: src/utils.ts
|
|
694
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
695
|
-
*/
|
|
696
|
-
/**
|
|
697
|
-
* @param {?} first
|
|
698
|
-
* @param {?} second
|
|
699
|
-
* @return {?}
|
|
700
|
-
*/
|
|
701
478
|
function difference(first, second) {
|
|
702
|
-
return first.filter((
|
|
703
|
-
* @param {?} item
|
|
704
|
-
* @return {?}
|
|
705
|
-
*/function (item) { return second.indexOf(item) < 0; }));
|
|
479
|
+
return first.filter(function (item) { return second.indexOf(item) < 0; });
|
|
706
480
|
}
|
|
707
481
|
/**
|
|
708
482
|
* Provides an app's view into the state of the lifted store.
|
|
709
|
-
* @param {?} liftedState
|
|
710
|
-
* @return {?}
|
|
711
483
|
*/
|
|
712
484
|
function unliftState(liftedState) {
|
|
713
485
|
var computedStates = liftedState.computedStates, currentStateIndex = liftedState.currentStateIndex;
|
|
@@ -722,104 +494,60 @@
|
|
|
722
494
|
var state = computedStates[currentStateIndex].state;
|
|
723
495
|
return state;
|
|
724
496
|
}
|
|
725
|
-
/**
|
|
726
|
-
* @param {?} liftedState
|
|
727
|
-
* @return {?}
|
|
728
|
-
*/
|
|
729
497
|
function unliftAction(liftedState) {
|
|
730
498
|
return liftedState.actionsById[liftedState.nextActionId - 1];
|
|
731
499
|
}
|
|
732
500
|
/**
|
|
733
501
|
* Lifts an app's action into an action on the lifted store.
|
|
734
|
-
* @param {?} action
|
|
735
|
-
* @return {?}
|
|
736
502
|
*/
|
|
737
503
|
function liftAction(action) {
|
|
738
504
|
return new PerformAction(action, +Date.now());
|
|
739
505
|
}
|
|
740
506
|
/**
|
|
741
507
|
* Sanitizes given actions with given function.
|
|
742
|
-
* @param {?} actionSanitizer
|
|
743
|
-
* @param {?} actions
|
|
744
|
-
* @return {?}
|
|
745
508
|
*/
|
|
746
509
|
function sanitizeActions(actionSanitizer, actions) {
|
|
747
|
-
return Object.keys(actions).reduce((
|
|
748
|
-
* @param {?} sanitizedActions
|
|
749
|
-
* @param {?} actionIdx
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/function (sanitizedActions, actionIdx) {
|
|
752
|
-
/** @type {?} */
|
|
510
|
+
return Object.keys(actions).reduce(function (sanitizedActions, actionIdx) {
|
|
753
511
|
var idx = Number(actionIdx);
|
|
754
512
|
sanitizedActions[idx] = sanitizeAction(actionSanitizer, actions[idx], idx);
|
|
755
513
|
return sanitizedActions;
|
|
756
|
-
}
|
|
514
|
+
}, {});
|
|
757
515
|
}
|
|
758
516
|
/**
|
|
759
517
|
* Sanitizes given action with given function.
|
|
760
|
-
* @param {?} actionSanitizer
|
|
761
|
-
* @param {?} action
|
|
762
|
-
* @param {?} actionIdx
|
|
763
|
-
* @return {?}
|
|
764
518
|
*/
|
|
765
519
|
function sanitizeAction(actionSanitizer, action, actionIdx) {
|
|
766
520
|
return Object.assign(Object.assign({}, action), { action: actionSanitizer(action.action, actionIdx) });
|
|
767
521
|
}
|
|
768
522
|
/**
|
|
769
523
|
* Sanitizes given states with given function.
|
|
770
|
-
* @param {?} stateSanitizer
|
|
771
|
-
* @param {?} states
|
|
772
|
-
* @return {?}
|
|
773
524
|
*/
|
|
774
525
|
function sanitizeStates(stateSanitizer, states) {
|
|
775
|
-
return states.map((
|
|
776
|
-
* @param {?} computedState
|
|
777
|
-
* @param {?} idx
|
|
778
|
-
* @return {?}
|
|
779
|
-
*/function (computedState, idx) { return ({
|
|
526
|
+
return states.map(function (computedState, idx) { return ({
|
|
780
527
|
state: sanitizeState(stateSanitizer, computedState.state, idx),
|
|
781
528
|
error: computedState.error,
|
|
782
|
-
}); })
|
|
529
|
+
}); });
|
|
783
530
|
}
|
|
784
531
|
/**
|
|
785
532
|
* Sanitizes given state with given function.
|
|
786
|
-
* @param {?} stateSanitizer
|
|
787
|
-
* @param {?} state
|
|
788
|
-
* @param {?} stateIdx
|
|
789
|
-
* @return {?}
|
|
790
533
|
*/
|
|
791
534
|
function sanitizeState(stateSanitizer, state, stateIdx) {
|
|
792
535
|
return stateSanitizer(state, stateIdx);
|
|
793
536
|
}
|
|
794
537
|
/**
|
|
795
538
|
* Read the config and tell if actions should be filtered
|
|
796
|
-
* @param {?} config
|
|
797
|
-
* @return {?}
|
|
798
539
|
*/
|
|
799
540
|
function shouldFilterActions(config) {
|
|
800
541
|
return config.predicate || config.actionsSafelist || config.actionsBlocklist;
|
|
801
542
|
}
|
|
802
543
|
/**
|
|
803
544
|
* Return a full filtered lifted state
|
|
804
|
-
* @param {?} liftedState
|
|
805
|
-
* @param {?=} predicate
|
|
806
|
-
* @param {?=} safelist
|
|
807
|
-
* @param {?=} blocklist
|
|
808
|
-
* @return {?}
|
|
809
545
|
*/
|
|
810
546
|
function filterLiftedState(liftedState, predicate, safelist, blocklist) {
|
|
811
|
-
/** @type {?} */
|
|
812
547
|
var filteredStagedActionIds = [];
|
|
813
|
-
/** @type {?} */
|
|
814
548
|
var filteredActionsById = {};
|
|
815
|
-
/** @type {?} */
|
|
816
549
|
var filteredComputedStates = [];
|
|
817
|
-
liftedState.stagedActionIds.forEach((
|
|
818
|
-
* @param {?} id
|
|
819
|
-
* @param {?} idx
|
|
820
|
-
* @return {?}
|
|
821
|
-
*/function (id, idx) {
|
|
822
|
-
/** @type {?} */
|
|
550
|
+
liftedState.stagedActionIds.forEach(function (id, idx) {
|
|
823
551
|
var liftedAction = liftedState.actionsById[id];
|
|
824
552
|
if (!liftedAction)
|
|
825
553
|
return;
|
|
@@ -830,139 +558,42 @@
|
|
|
830
558
|
filteredActionsById[id] = liftedAction;
|
|
831
559
|
filteredStagedActionIds.push(id);
|
|
832
560
|
filteredComputedStates.push(liftedState.computedStates[idx]);
|
|
833
|
-
})
|
|
561
|
+
});
|
|
834
562
|
return Object.assign(Object.assign({}, liftedState), { stagedActionIds: filteredStagedActionIds, actionsById: filteredActionsById, computedStates: filteredComputedStates });
|
|
835
563
|
}
|
|
836
564
|
/**
|
|
837
565
|
* Return true is the action should be ignored
|
|
838
|
-
* @param {?} state
|
|
839
|
-
* @param {?} action
|
|
840
|
-
* @param {?=} predicate
|
|
841
|
-
* @param {?=} safelist
|
|
842
|
-
* @param {?=} blockedlist
|
|
843
|
-
* @return {?}
|
|
844
566
|
*/
|
|
845
567
|
function isActionFiltered(state, action, predicate, safelist, blockedlist) {
|
|
846
|
-
/** @type {?} */
|
|
847
568
|
var predicateMatch = predicate && !predicate(state, action.action);
|
|
848
|
-
/** @type {?} */
|
|
849
569
|
var safelistMatch = safelist &&
|
|
850
|
-
!action.action.type.match(safelist.map((
|
|
851
|
-
* @param {?} s
|
|
852
|
-
* @return {?}
|
|
853
|
-
*/function (s) { return escapeRegExp(s); })).join('|'));
|
|
854
|
-
/** @type {?} */
|
|
570
|
+
!action.action.type.match(safelist.map(function (s) { return escapeRegExp(s); }).join('|'));
|
|
855
571
|
var blocklistMatch = blockedlist &&
|
|
856
|
-
action.action.type.match(blockedlist.map((
|
|
857
|
-
* @param {?} s
|
|
858
|
-
* @return {?}
|
|
859
|
-
*/function (s) { return escapeRegExp(s); })).join('|'));
|
|
572
|
+
action.action.type.match(blockedlist.map(function (s) { return escapeRegExp(s); }).join('|'));
|
|
860
573
|
return predicateMatch || safelistMatch || blocklistMatch;
|
|
861
574
|
}
|
|
862
575
|
/**
|
|
863
576
|
* Return string with escaped RegExp special characters
|
|
864
577
|
* https://stackoverflow.com/a/6969486/1337347
|
|
865
|
-
* @param {?} s
|
|
866
|
-
* @return {?}
|
|
867
578
|
*/
|
|
868
579
|
function escapeRegExp(s) {
|
|
869
580
|
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
870
581
|
}
|
|
871
582
|
|
|
872
|
-
/**
|
|
873
|
-
* @fileoverview added by tsickle
|
|
874
|
-
* Generated from: src/extension.ts
|
|
875
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
876
|
-
*/
|
|
877
|
-
/** @type {?} */
|
|
878
583
|
var ExtensionActionTypes = {
|
|
879
584
|
START: 'START',
|
|
880
585
|
DISPATCH: 'DISPATCH',
|
|
881
586
|
STOP: 'STOP',
|
|
882
587
|
ACTION: 'ACTION',
|
|
883
588
|
};
|
|
884
|
-
/** @type {?} */
|
|
885
589
|
var REDUX_DEVTOOLS_EXTENSION = new core.InjectionToken('@ngrx/store-devtools Redux Devtools Extension');
|
|
886
|
-
/**
|
|
887
|
-
* @record
|
|
888
|
-
*/
|
|
889
|
-
function ReduxDevtoolsExtensionConnection() { }
|
|
890
|
-
if (false) {
|
|
891
|
-
/**
|
|
892
|
-
* @param {?} listener
|
|
893
|
-
* @return {?}
|
|
894
|
-
*/
|
|
895
|
-
ReduxDevtoolsExtensionConnection.prototype.subscribe = function (listener) { };
|
|
896
|
-
/**
|
|
897
|
-
* @return {?}
|
|
898
|
-
*/
|
|
899
|
-
ReduxDevtoolsExtensionConnection.prototype.unsubscribe = function () { };
|
|
900
|
-
/**
|
|
901
|
-
* @param {?} action
|
|
902
|
-
* @param {?} state
|
|
903
|
-
* @return {?}
|
|
904
|
-
*/
|
|
905
|
-
ReduxDevtoolsExtensionConnection.prototype.send = function (action, state) { };
|
|
906
|
-
/**
|
|
907
|
-
* @param {?=} state
|
|
908
|
-
* @return {?}
|
|
909
|
-
*/
|
|
910
|
-
ReduxDevtoolsExtensionConnection.prototype.init = function (state) { };
|
|
911
|
-
/**
|
|
912
|
-
* @param {?} anyErr
|
|
913
|
-
* @return {?}
|
|
914
|
-
*/
|
|
915
|
-
ReduxDevtoolsExtensionConnection.prototype.error = function (anyErr) { };
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* @record
|
|
919
|
-
*/
|
|
920
|
-
function ReduxDevtoolsExtensionConfig() { }
|
|
921
|
-
if (false) {
|
|
922
|
-
/** @type {?|undefined} */
|
|
923
|
-
ReduxDevtoolsExtensionConfig.prototype.features;
|
|
924
|
-
/** @type {?} */
|
|
925
|
-
ReduxDevtoolsExtensionConfig.prototype.name;
|
|
926
|
-
/** @type {?|undefined} */
|
|
927
|
-
ReduxDevtoolsExtensionConfig.prototype.maxAge;
|
|
928
|
-
/** @type {?|undefined} */
|
|
929
|
-
ReduxDevtoolsExtensionConfig.prototype.serialize;
|
|
930
|
-
}
|
|
931
|
-
/**
|
|
932
|
-
* @record
|
|
933
|
-
*/
|
|
934
|
-
function ReduxDevtoolsExtension() { }
|
|
935
|
-
if (false) {
|
|
936
|
-
/**
|
|
937
|
-
* @param {?} options
|
|
938
|
-
* @return {?}
|
|
939
|
-
*/
|
|
940
|
-
ReduxDevtoolsExtension.prototype.connect = function (options) { };
|
|
941
|
-
/**
|
|
942
|
-
* @param {?} action
|
|
943
|
-
* @param {?} state
|
|
944
|
-
* @param {?} options
|
|
945
|
-
* @return {?}
|
|
946
|
-
*/
|
|
947
|
-
ReduxDevtoolsExtension.prototype.send = function (action, state, options) { };
|
|
948
|
-
}
|
|
949
590
|
var DevtoolsExtension = /** @class */ (function () {
|
|
950
|
-
/**
|
|
951
|
-
* @param {?} devtoolsExtension
|
|
952
|
-
* @param {?} config
|
|
953
|
-
* @param {?} dispatcher
|
|
954
|
-
*/
|
|
955
591
|
function DevtoolsExtension(devtoolsExtension, config, dispatcher) {
|
|
956
592
|
this.config = config;
|
|
957
593
|
this.dispatcher = dispatcher;
|
|
958
594
|
this.devtoolsExtension = devtoolsExtension;
|
|
959
595
|
this.createActionStreams();
|
|
960
596
|
}
|
|
961
|
-
/**
|
|
962
|
-
* @param {?} action
|
|
963
|
-
* @param {?} state
|
|
964
|
-
* @return {?}
|
|
965
|
-
*/
|
|
966
597
|
DevtoolsExtension.prototype.notify = function (action, state) {
|
|
967
598
|
var _this = this;
|
|
968
599
|
if (!this.devtoolsExtension) {
|
|
@@ -985,94 +616,52 @@
|
|
|
985
616
|
if (state.isLocked || state.isPaused) {
|
|
986
617
|
return;
|
|
987
618
|
}
|
|
988
|
-
/** @type {?} */
|
|
989
619
|
var currentState = unliftState(state);
|
|
990
620
|
if (shouldFilterActions(this.config) &&
|
|
991
621
|
isActionFiltered(currentState, action, this.config.predicate, this.config.actionsSafelist, this.config.actionsBlocklist)) {
|
|
992
622
|
return;
|
|
993
623
|
}
|
|
994
|
-
/** @type {?} */
|
|
995
624
|
var sanitizedState_1 = this.config.stateSanitizer
|
|
996
625
|
? sanitizeState(this.config.stateSanitizer, currentState, state.currentStateIndex)
|
|
997
626
|
: currentState;
|
|
998
|
-
/** @type {?} */
|
|
999
627
|
var sanitizedAction_1 = this.config.actionSanitizer
|
|
1000
628
|
? sanitizeAction(this.config.actionSanitizer, action, state.nextActionId)
|
|
1001
629
|
: action;
|
|
1002
|
-
this.sendToReduxDevtools((
|
|
1003
|
-
* @return {?}
|
|
1004
|
-
*/function () { return _this.extensionConnection.send(sanitizedAction_1, sanitizedState_1); }));
|
|
630
|
+
this.sendToReduxDevtools(function () { return _this.extensionConnection.send(sanitizedAction_1, sanitizedState_1); });
|
|
1005
631
|
}
|
|
1006
632
|
else {
|
|
1007
633
|
// Requires full state update
|
|
1008
|
-
/** @type {?} */
|
|
1009
634
|
var sanitizedLiftedState_1 = Object.assign(Object.assign({}, state), { stagedActionIds: state.stagedActionIds, actionsById: this.config.actionSanitizer
|
|
1010
635
|
? sanitizeActions(this.config.actionSanitizer, state.actionsById)
|
|
1011
636
|
: state.actionsById, computedStates: this.config.stateSanitizer
|
|
1012
637
|
? sanitizeStates(this.config.stateSanitizer, state.computedStates)
|
|
1013
638
|
: state.computedStates });
|
|
1014
|
-
this.sendToReduxDevtools((
|
|
1015
|
-
* @return {?}
|
|
1016
|
-
*/function () { return _this.devtoolsExtension.send(null, sanitizedLiftedState_1, _this.getExtensionConfig(_this.config)); }));
|
|
639
|
+
this.sendToReduxDevtools(function () { return _this.devtoolsExtension.send(null, sanitizedLiftedState_1, _this.getExtensionConfig(_this.config)); });
|
|
1017
640
|
}
|
|
1018
641
|
};
|
|
1019
|
-
/**
|
|
1020
|
-
* @private
|
|
1021
|
-
* @return {?}
|
|
1022
|
-
*/
|
|
1023
642
|
DevtoolsExtension.prototype.createChangesObservable = function () {
|
|
1024
643
|
var _this = this;
|
|
1025
644
|
if (!this.devtoolsExtension) {
|
|
1026
645
|
return rxjs.EMPTY;
|
|
1027
646
|
}
|
|
1028
|
-
return new rxjs.Observable((
|
|
1029
|
-
* @param {?} subscriber
|
|
1030
|
-
* @return {?}
|
|
1031
|
-
*/function (subscriber) {
|
|
1032
|
-
/** @type {?} */
|
|
647
|
+
return new rxjs.Observable(function (subscriber) {
|
|
1033
648
|
var connection = _this.devtoolsExtension.connect(_this.getExtensionConfig(_this.config));
|
|
1034
649
|
_this.extensionConnection = connection;
|
|
1035
650
|
connection.init();
|
|
1036
|
-
connection.subscribe((
|
|
1037
|
-
* @param {?} change
|
|
1038
|
-
* @return {?}
|
|
1039
|
-
*/function (change) { return subscriber.next(change); }));
|
|
651
|
+
connection.subscribe(function (change) { return subscriber.next(change); });
|
|
1040
652
|
return connection.unsubscribe;
|
|
1041
|
-
})
|
|
653
|
+
});
|
|
1042
654
|
};
|
|
1043
|
-
/**
|
|
1044
|
-
* @private
|
|
1045
|
-
* @return {?}
|
|
1046
|
-
*/
|
|
1047
655
|
DevtoolsExtension.prototype.createActionStreams = function () {
|
|
1048
656
|
var _this = this;
|
|
1049
657
|
// Listens to all changes
|
|
1050
|
-
/** @type {?} */
|
|
1051
658
|
var changes$ = this.createChangesObservable().pipe(operators.share());
|
|
1052
659
|
// Listen for the start action
|
|
1053
|
-
|
|
1054
|
-
var start$ = changes$.pipe(operators.filter(( /**
|
|
1055
|
-
* @param {?} change
|
|
1056
|
-
* @return {?}
|
|
1057
|
-
*/function (change) { return change.type === ExtensionActionTypes.START; })));
|
|
660
|
+
var start$ = changes$.pipe(operators.filter(function (change) { return change.type === ExtensionActionTypes.START; }));
|
|
1058
661
|
// Listen for the stop action
|
|
1059
|
-
|
|
1060
|
-
var stop$ = changes$.pipe(operators.filter(( /**
|
|
1061
|
-
* @param {?} change
|
|
1062
|
-
* @return {?}
|
|
1063
|
-
*/function (change) { return change.type === ExtensionActionTypes.STOP; })));
|
|
662
|
+
var stop$ = changes$.pipe(operators.filter(function (change) { return change.type === ExtensionActionTypes.STOP; }));
|
|
1064
663
|
// Listen for lifted actions
|
|
1065
|
-
|
|
1066
|
-
var liftedActions$ = changes$.pipe(operators.filter(( /**
|
|
1067
|
-
* @param {?} change
|
|
1068
|
-
* @return {?}
|
|
1069
|
-
*/function (change) { return change.type === ExtensionActionTypes.DISPATCH; })), operators.map(( /**
|
|
1070
|
-
* @param {?} change
|
|
1071
|
-
* @return {?}
|
|
1072
|
-
*/function (change) { return _this.unwrapAction(change.payload); })), operators.concatMap(( /**
|
|
1073
|
-
* @param {?} action
|
|
1074
|
-
* @return {?}
|
|
1075
|
-
*/function (action) {
|
|
664
|
+
var liftedActions$ = changes$.pipe(operators.filter(function (change) { return change.type === ExtensionActionTypes.DISPATCH; }), operators.map(function (change) { return _this.unwrapAction(change.payload); }), operators.concatMap(function (action) {
|
|
1076
665
|
if (action.type === IMPORT_STATE) {
|
|
1077
666
|
// State imports may happen in two situations:
|
|
1078
667
|
// 1. Explicitly by user
|
|
@@ -1082,56 +671,25 @@
|
|
|
1082
671
|
// lazy loaded reducers time to instantiate.
|
|
1083
672
|
// As soon as there is no UPDATE action within 1 second,
|
|
1084
673
|
// it is assumed that all reducers are loaded.
|
|
1085
|
-
return _this.dispatcher.pipe(operators.filter((
|
|
1086
|
-
* @param {?} action
|
|
1087
|
-
* @return {?}
|
|
1088
|
-
*/function (action) { return action.type === store.UPDATE; })), operators.timeout(1000), operators.debounceTime(1000), operators.map(( /**
|
|
1089
|
-
* @return {?}
|
|
1090
|
-
*/function () { return action; })), operators.catchError(( /**
|
|
1091
|
-
* @return {?}
|
|
1092
|
-
*/function () { return rxjs.of(action); })), operators.take(1));
|
|
674
|
+
return _this.dispatcher.pipe(operators.filter(function (action) { return action.type === store.UPDATE; }), operators.timeout(1000), operators.debounceTime(1000), operators.map(function () { return action; }), operators.catchError(function () { return rxjs.of(action); }), operators.take(1));
|
|
1093
675
|
}
|
|
1094
676
|
else {
|
|
1095
677
|
return rxjs.of(action);
|
|
1096
678
|
}
|
|
1097
|
-
}))
|
|
679
|
+
}));
|
|
1098
680
|
// Listen for unlifted actions
|
|
1099
|
-
|
|
1100
|
-
var actions$ = changes$.pipe(operators.filter(( /**
|
|
1101
|
-
* @param {?} change
|
|
1102
|
-
* @return {?}
|
|
1103
|
-
*/function (change) { return change.type === ExtensionActionTypes.ACTION; })), operators.map(( /**
|
|
1104
|
-
* @param {?} change
|
|
1105
|
-
* @return {?}
|
|
1106
|
-
*/function (change) { return _this.unwrapAction(change.payload); })));
|
|
1107
|
-
/** @type {?} */
|
|
681
|
+
var actions$ = changes$.pipe(operators.filter(function (change) { return change.type === ExtensionActionTypes.ACTION; }), operators.map(function (change) { return _this.unwrapAction(change.payload); }));
|
|
1108
682
|
var actionsUntilStop$ = actions$.pipe(operators.takeUntil(stop$));
|
|
1109
|
-
/** @type {?} */
|
|
1110
683
|
var liftedUntilStop$ = liftedActions$.pipe(operators.takeUntil(stop$));
|
|
1111
684
|
this.start$ = start$.pipe(operators.takeUntil(stop$));
|
|
1112
685
|
// Only take the action sources between the start/stop events
|
|
1113
|
-
this.actions$ = this.start$.pipe(operators.switchMap((
|
|
1114
|
-
|
|
1115
|
-
*/function () { return actionsUntilStop$; })));
|
|
1116
|
-
this.liftedActions$ = this.start$.pipe(operators.switchMap(( /**
|
|
1117
|
-
* @return {?}
|
|
1118
|
-
*/function () { return liftedUntilStop$; })));
|
|
686
|
+
this.actions$ = this.start$.pipe(operators.switchMap(function () { return actionsUntilStop$; }));
|
|
687
|
+
this.liftedActions$ = this.start$.pipe(operators.switchMap(function () { return liftedUntilStop$; }));
|
|
1119
688
|
};
|
|
1120
|
-
/**
|
|
1121
|
-
* @private
|
|
1122
|
-
* @param {?} action
|
|
1123
|
-
* @return {?}
|
|
1124
|
-
*/
|
|
1125
689
|
DevtoolsExtension.prototype.unwrapAction = function (action) {
|
|
1126
690
|
return typeof action === 'string' ? eval("(" + action + ")") : action;
|
|
1127
691
|
};
|
|
1128
|
-
/**
|
|
1129
|
-
* @private
|
|
1130
|
-
* @param {?} config
|
|
1131
|
-
* @return {?}
|
|
1132
|
-
*/
|
|
1133
692
|
DevtoolsExtension.prototype.getExtensionConfig = function (config) {
|
|
1134
|
-
/** @type {?} */
|
|
1135
693
|
var extensionOptions = {
|
|
1136
694
|
name: config.name,
|
|
1137
695
|
features: config.features,
|
|
@@ -1142,11 +700,6 @@
|
|
|
1142
700
|
}
|
|
1143
701
|
return extensionOptions;
|
|
1144
702
|
};
|
|
1145
|
-
/**
|
|
1146
|
-
* @private
|
|
1147
|
-
* @param {?} send
|
|
1148
|
-
* @return {?}
|
|
1149
|
-
*/
|
|
1150
703
|
DevtoolsExtension.prototype.sendToReduxDevtools = function (send) {
|
|
1151
704
|
try {
|
|
1152
705
|
send();
|
|
@@ -1166,99 +719,12 @@
|
|
|
1166
719
|
{ type: StoreDevtoolsConfig, decorators: [{ type: core.Inject, args: [STORE_DEVTOOLS_CONFIG,] }] },
|
|
1167
720
|
{ type: DevtoolsDispatcher }
|
|
1168
721
|
]; };
|
|
1169
|
-
if (false) {
|
|
1170
|
-
/**
|
|
1171
|
-
* @type {?}
|
|
1172
|
-
* @private
|
|
1173
|
-
*/
|
|
1174
|
-
DevtoolsExtension.prototype.devtoolsExtension;
|
|
1175
|
-
/**
|
|
1176
|
-
* @type {?}
|
|
1177
|
-
* @private
|
|
1178
|
-
*/
|
|
1179
|
-
DevtoolsExtension.prototype.extensionConnection;
|
|
1180
|
-
/** @type {?} */
|
|
1181
|
-
DevtoolsExtension.prototype.liftedActions$;
|
|
1182
|
-
/** @type {?} */
|
|
1183
|
-
DevtoolsExtension.prototype.actions$;
|
|
1184
|
-
/** @type {?} */
|
|
1185
|
-
DevtoolsExtension.prototype.start$;
|
|
1186
|
-
/**
|
|
1187
|
-
* @type {?}
|
|
1188
|
-
* @private
|
|
1189
|
-
*/
|
|
1190
|
-
DevtoolsExtension.prototype.config;
|
|
1191
|
-
/**
|
|
1192
|
-
* @type {?}
|
|
1193
|
-
* @private
|
|
1194
|
-
*/
|
|
1195
|
-
DevtoolsExtension.prototype.dispatcher;
|
|
1196
|
-
}
|
|
1197
722
|
|
|
1198
|
-
/** @type {?} */
|
|
1199
723
|
var INIT_ACTION = { type: store.INIT };
|
|
1200
|
-
|
|
1201
|
-
var RECOMPUTE = ( /** @type {?} */('@ngrx/store-devtools/recompute'));
|
|
1202
|
-
/** @type {?} */
|
|
724
|
+
var RECOMPUTE = '@ngrx/store-devtools/recompute';
|
|
1203
725
|
var RECOMPUTE_ACTION = { type: RECOMPUTE };
|
|
1204
|
-
/**
|
|
1205
|
-
* @record
|
|
1206
|
-
*/
|
|
1207
|
-
function ComputedState() { }
|
|
1208
|
-
if (false) {
|
|
1209
|
-
/** @type {?} */
|
|
1210
|
-
ComputedState.prototype.state;
|
|
1211
|
-
/** @type {?} */
|
|
1212
|
-
ComputedState.prototype.error;
|
|
1213
|
-
}
|
|
1214
|
-
/**
|
|
1215
|
-
* @record
|
|
1216
|
-
*/
|
|
1217
|
-
function LiftedAction() { }
|
|
1218
|
-
if (false) {
|
|
1219
|
-
/** @type {?} */
|
|
1220
|
-
LiftedAction.prototype.type;
|
|
1221
|
-
/** @type {?} */
|
|
1222
|
-
LiftedAction.prototype.action;
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* @record
|
|
1226
|
-
*/
|
|
1227
|
-
function LiftedActions() { }
|
|
1228
|
-
/**
|
|
1229
|
-
* @record
|
|
1230
|
-
*/
|
|
1231
|
-
function LiftedState() { }
|
|
1232
|
-
if (false) {
|
|
1233
|
-
/** @type {?} */
|
|
1234
|
-
LiftedState.prototype.monitorState;
|
|
1235
|
-
/** @type {?} */
|
|
1236
|
-
LiftedState.prototype.nextActionId;
|
|
1237
|
-
/** @type {?} */
|
|
1238
|
-
LiftedState.prototype.actionsById;
|
|
1239
|
-
/** @type {?} */
|
|
1240
|
-
LiftedState.prototype.stagedActionIds;
|
|
1241
|
-
/** @type {?} */
|
|
1242
|
-
LiftedState.prototype.skippedActionIds;
|
|
1243
|
-
/** @type {?} */
|
|
1244
|
-
LiftedState.prototype.committedState;
|
|
1245
|
-
/** @type {?} */
|
|
1246
|
-
LiftedState.prototype.currentStateIndex;
|
|
1247
|
-
/** @type {?} */
|
|
1248
|
-
LiftedState.prototype.computedStates;
|
|
1249
|
-
/** @type {?} */
|
|
1250
|
-
LiftedState.prototype.isLocked;
|
|
1251
|
-
/** @type {?} */
|
|
1252
|
-
LiftedState.prototype.isPaused;
|
|
1253
|
-
}
|
|
1254
726
|
/**
|
|
1255
727
|
* Computes the next entry in the log by applying an action.
|
|
1256
|
-
* @param {?} reducer
|
|
1257
|
-
* @param {?} action
|
|
1258
|
-
* @param {?} state
|
|
1259
|
-
* @param {?} error
|
|
1260
|
-
* @param {?} errorHandler
|
|
1261
|
-
* @return {?}
|
|
1262
728
|
*/
|
|
1263
729
|
function computeNextEntry(reducer, action, state, error, errorHandler) {
|
|
1264
730
|
if (error) {
|
|
@@ -1267,9 +733,7 @@
|
|
|
1267
733
|
error: 'Interrupted by an error up the chain',
|
|
1268
734
|
};
|
|
1269
735
|
}
|
|
1270
|
-
/** @type {?} */
|
|
1271
736
|
var nextState = state;
|
|
1272
|
-
/** @type {?} */
|
|
1273
737
|
var nextError;
|
|
1274
738
|
try {
|
|
1275
739
|
nextState = reducer(state, action);
|
|
@@ -1285,16 +749,6 @@
|
|
|
1285
749
|
}
|
|
1286
750
|
/**
|
|
1287
751
|
* Runs the reducer on invalidated actions to get a fresh computation log.
|
|
1288
|
-
* @param {?} computedStates
|
|
1289
|
-
* @param {?} minInvalidatedStateIndex
|
|
1290
|
-
* @param {?} reducer
|
|
1291
|
-
* @param {?} committedState
|
|
1292
|
-
* @param {?} actionsById
|
|
1293
|
-
* @param {?} stagedActionIds
|
|
1294
|
-
* @param {?} skippedActionIds
|
|
1295
|
-
* @param {?} errorHandler
|
|
1296
|
-
* @param {?} isPaused
|
|
1297
|
-
* @return {?}
|
|
1298
752
|
*/
|
|
1299
753
|
function recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused) {
|
|
1300
754
|
// Optimization: exit early and return the same reference
|
|
@@ -1303,26 +757,17 @@
|
|
|
1303
757
|
computedStates.length === stagedActionIds.length) {
|
|
1304
758
|
return computedStates;
|
|
1305
759
|
}
|
|
1306
|
-
/** @type {?} */
|
|
1307
760
|
var nextComputedStates = computedStates.slice(0, minInvalidatedStateIndex);
|
|
1308
761
|
// If the recording is paused, recompute all states up until the pause state,
|
|
1309
762
|
// else recompute all states.
|
|
1310
|
-
/** @type {?} */
|
|
1311
763
|
var lastIncludedActionId = stagedActionIds.length - (isPaused ? 1 : 0);
|
|
1312
764
|
for (var i = minInvalidatedStateIndex; i < lastIncludedActionId; i++) {
|
|
1313
|
-
/** @type {?} */
|
|
1314
765
|
var actionId = stagedActionIds[i];
|
|
1315
|
-
/** @type {?} */
|
|
1316
766
|
var action = actionsById[actionId].action;
|
|
1317
|
-
/** @type {?} */
|
|
1318
767
|
var previousEntry = nextComputedStates[i - 1];
|
|
1319
|
-
/** @type {?} */
|
|
1320
768
|
var previousState = previousEntry ? previousEntry.state : committedState;
|
|
1321
|
-
/** @type {?} */
|
|
1322
769
|
var previousError = previousEntry ? previousEntry.error : undefined;
|
|
1323
|
-
/** @type {?} */
|
|
1324
770
|
var shouldSkip = skippedActionIds.indexOf(actionId) > -1;
|
|
1325
|
-
/** @type {?} */
|
|
1326
771
|
var entry = shouldSkip
|
|
1327
772
|
? previousEntry
|
|
1328
773
|
: computeNextEntry(reducer, action, previousState, previousError, errorHandler);
|
|
@@ -1335,11 +780,6 @@
|
|
|
1335
780
|
}
|
|
1336
781
|
return nextComputedStates;
|
|
1337
782
|
}
|
|
1338
|
-
/**
|
|
1339
|
-
* @param {?=} initialCommittedState
|
|
1340
|
-
* @param {?=} monitorReducer
|
|
1341
|
-
* @return {?}
|
|
1342
|
-
*/
|
|
1343
783
|
function liftInitialState(initialCommittedState, monitorReducer) {
|
|
1344
784
|
return {
|
|
1345
785
|
monitorState: monitorReducer(undefined, {}),
|
|
@@ -1356,41 +796,22 @@
|
|
|
1356
796
|
}
|
|
1357
797
|
/**
|
|
1358
798
|
* Creates a history state reducer from an app's reducer.
|
|
1359
|
-
* @param {?} initialCommittedState
|
|
1360
|
-
* @param {?} initialLiftedState
|
|
1361
|
-
* @param {?} errorHandler
|
|
1362
|
-
* @param {?=} monitorReducer
|
|
1363
|
-
* @param {?=} options
|
|
1364
|
-
* @return {?}
|
|
1365
799
|
*/
|
|
1366
800
|
function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler, monitorReducer, options) {
|
|
1367
801
|
if (options === void 0) { options = {}; }
|
|
1368
802
|
/**
|
|
1369
803
|
* Manages how the history actions modify the history state.
|
|
1370
804
|
*/
|
|
1371
|
-
return (
|
|
1372
|
-
* @param {?} reducer
|
|
1373
|
-
* @return {?}
|
|
1374
|
-
*/function (reducer) { return ( /**
|
|
1375
|
-
* @param {?} liftedState
|
|
1376
|
-
* @param {?} liftedAction
|
|
1377
|
-
* @return {?}
|
|
1378
|
-
*/function (liftedState, liftedAction) {
|
|
805
|
+
return function (reducer) { return function (liftedState, liftedAction) {
|
|
1379
806
|
var _a;
|
|
1380
807
|
var _b = liftedState || initialLiftedState, monitorState = _b.monitorState, actionsById = _b.actionsById, nextActionId = _b.nextActionId, stagedActionIds = _b.stagedActionIds, skippedActionIds = _b.skippedActionIds, committedState = _b.committedState, currentStateIndex = _b.currentStateIndex, computedStates = _b.computedStates, isLocked = _b.isLocked, isPaused = _b.isPaused;
|
|
1381
808
|
if (!liftedState) {
|
|
1382
809
|
// Prevent mutating initialLiftedState
|
|
1383
810
|
actionsById = Object.create(actionsById);
|
|
1384
811
|
}
|
|
1385
|
-
/**
|
|
1386
|
-
* @param {?} n
|
|
1387
|
-
* @return {?}
|
|
1388
|
-
*/
|
|
1389
812
|
function commitExcessActions(n) {
|
|
1390
813
|
// Auto-commits n-number of excess actions.
|
|
1391
|
-
/** @type {?} */
|
|
1392
814
|
var excess = n;
|
|
1393
|
-
/** @type {?} */
|
|
1394
815
|
var idsToDelete = stagedActionIds.slice(1, excess + 1);
|
|
1395
816
|
for (var i = 0; i < idsToDelete.length; i++) {
|
|
1396
817
|
if (computedStates[i + 1].error) {
|
|
@@ -1403,19 +824,13 @@
|
|
|
1403
824
|
delete actionsById[idsToDelete[i]];
|
|
1404
825
|
}
|
|
1405
826
|
}
|
|
1406
|
-
skippedActionIds = skippedActionIds.filter((
|
|
1407
|
-
* @param {?} id
|
|
1408
|
-
* @return {?}
|
|
1409
|
-
*/function (id) { return idsToDelete.indexOf(id) === -1; }));
|
|
827
|
+
skippedActionIds = skippedActionIds.filter(function (id) { return idsToDelete.indexOf(id) === -1; });
|
|
1410
828
|
stagedActionIds = __spread([0], stagedActionIds.slice(excess + 1));
|
|
1411
829
|
committedState = computedStates[excess].state;
|
|
1412
830
|
computedStates = computedStates.slice(excess);
|
|
1413
831
|
currentStateIndex =
|
|
1414
832
|
currentStateIndex > excess ? currentStateIndex - excess : 0;
|
|
1415
833
|
}
|
|
1416
|
-
/**
|
|
1417
|
-
* @return {?}
|
|
1418
|
-
*/
|
|
1419
834
|
function commitChanges() {
|
|
1420
835
|
// Consider the last committed state the new starting point.
|
|
1421
836
|
// Squash any staged actions into a single committed state.
|
|
@@ -1430,7 +845,6 @@
|
|
|
1430
845
|
// By default, aggressively recompute every state whatever happens.
|
|
1431
846
|
// This has O(n) performance, so we'll override this to a sensible
|
|
1432
847
|
// value whenever we feel like we don't have to recompute the states.
|
|
1433
|
-
/** @type {?} */
|
|
1434
848
|
var minInvalidatedStateIndex = 0;
|
|
1435
849
|
switch (liftedAction.type) {
|
|
1436
850
|
case LOCK_CHANGES: {
|
|
@@ -1491,16 +905,12 @@
|
|
|
1491
905
|
// Toggle whether an action with given ID is skipped.
|
|
1492
906
|
// Being skipped means it is a no-op during the computation.
|
|
1493
907
|
var actionId_1 = liftedAction.id;
|
|
1494
|
-
/** @type {?} */
|
|
1495
908
|
var index = skippedActionIds.indexOf(actionId_1);
|
|
1496
909
|
if (index === -1) {
|
|
1497
910
|
skippedActionIds = __spread([actionId_1], skippedActionIds);
|
|
1498
911
|
}
|
|
1499
912
|
else {
|
|
1500
|
-
skippedActionIds = skippedActionIds.filter((
|
|
1501
|
-
* @param {?} id
|
|
1502
|
-
* @return {?}
|
|
1503
|
-
*/function (id) { return id !== actionId_1; }));
|
|
913
|
+
skippedActionIds = skippedActionIds.filter(function (id) { return id !== actionId_1; });
|
|
1504
914
|
}
|
|
1505
915
|
// Optimization: we know history before this action hasn't changed
|
|
1506
916
|
minInvalidatedStateIndex = stagedActionIds.indexOf(actionId_1);
|
|
@@ -1510,7 +920,6 @@
|
|
|
1510
920
|
// Toggle whether an action with given ID is skipped.
|
|
1511
921
|
// Being skipped means it is a no-op during the computation.
|
|
1512
922
|
var start = liftedAction.start, end = liftedAction.end, active = liftedAction.active;
|
|
1513
|
-
/** @type {?} */
|
|
1514
923
|
var actionIds = [];
|
|
1515
924
|
for (var i = start; i < end; i++)
|
|
1516
925
|
actionIds.push(i);
|
|
@@ -1535,7 +944,6 @@
|
|
|
1535
944
|
case JUMP_TO_ACTION: {
|
|
1536
945
|
// Jumps to a corresponding state to a specific action.
|
|
1537
946
|
// Useful when filtering actions.
|
|
1538
|
-
/** @type {?} */
|
|
1539
947
|
var index = stagedActionIds.indexOf(liftedAction.actionId);
|
|
1540
948
|
if (index !== -1)
|
|
1541
949
|
currentStateIndex = index;
|
|
@@ -1561,7 +969,6 @@
|
|
|
1561
969
|
// (corresponds to the pause action) and keep everything else as is.
|
|
1562
970
|
// This way, the app gets the new current state while the devtools
|
|
1563
971
|
// do not record another action.
|
|
1564
|
-
/** @type {?} */
|
|
1565
972
|
var lastState = computedStates[computedStates.length - 1];
|
|
1566
973
|
computedStates = __spread(computedStates.slice(0, -1), [
|
|
1567
974
|
computeNextEntry(reducer, liftedAction.action, lastState.state, lastState.error, errorHandler),
|
|
@@ -1576,7 +983,6 @@
|
|
|
1576
983
|
if (currentStateIndex === stagedActionIds.length - 1) {
|
|
1577
984
|
currentStateIndex++;
|
|
1578
985
|
}
|
|
1579
|
-
/** @type {?} */
|
|
1580
986
|
var actionId = nextActionId++;
|
|
1581
987
|
// Mutation! This is the hottest path, and we optimize on purpose.
|
|
1582
988
|
// It is safe because we set a new key in a cache dictionary.
|
|
@@ -1604,11 +1010,7 @@
|
|
|
1604
1010
|
break;
|
|
1605
1011
|
}
|
|
1606
1012
|
case store.UPDATE: {
|
|
1607
|
-
|
|
1608
|
-
var stateHasErrors = computedStates.filter(( /**
|
|
1609
|
-
* @param {?} state
|
|
1610
|
-
* @return {?}
|
|
1611
|
-
*/function (state) { return state.error; })).length > 0;
|
|
1013
|
+
var stateHasErrors = computedStates.filter(function (state) { return state.error; }).length > 0;
|
|
1612
1014
|
if (stateHasErrors) {
|
|
1613
1015
|
// Recompute all states
|
|
1614
1016
|
minInvalidatedStateIndex = 0;
|
|
@@ -1628,7 +1030,6 @@
|
|
|
1628
1030
|
currentStateIndex++;
|
|
1629
1031
|
}
|
|
1630
1032
|
// Add a new action to only recompute state
|
|
1631
|
-
/** @type {?} */
|
|
1632
1033
|
var actionId = nextActionId++;
|
|
1633
1034
|
actionsById[actionId] = new PerformAction(liftedAction, +Date.now());
|
|
1634
1035
|
stagedActionIds = __spread(stagedActionIds, [actionId]);
|
|
@@ -1636,10 +1037,7 @@
|
|
|
1636
1037
|
computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);
|
|
1637
1038
|
}
|
|
1638
1039
|
// Recompute state history with latest reducer and update action
|
|
1639
|
-
computedStates = computedStates.map((
|
|
1640
|
-
* @param {?} cmp
|
|
1641
|
-
* @return {?}
|
|
1642
|
-
*/function (cmp) { return (Object.assign(Object.assign({}, cmp), { state: reducer(cmp.state, RECOMPUTE_ACTION) })); }));
|
|
1040
|
+
computedStates = computedStates.map(function (cmp) { return (Object.assign(Object.assign({}, cmp), { state: reducer(cmp.state, RECOMPUTE_ACTION) })); });
|
|
1643
1041
|
currentStateIndex = stagedActionIds.length - 1;
|
|
1644
1042
|
if (options.maxAge && stagedActionIds.length > options.maxAge) {
|
|
1645
1043
|
commitExcessActions(stagedActionIds.length - options.maxAge);
|
|
@@ -1670,42 +1068,21 @@
|
|
|
1670
1068
|
isLocked: isLocked,
|
|
1671
1069
|
isPaused: isPaused,
|
|
1672
1070
|
};
|
|
1673
|
-
}
|
|
1071
|
+
}; };
|
|
1674
1072
|
}
|
|
1675
1073
|
|
|
1676
1074
|
var StoreDevtools = /** @class */ (function () {
|
|
1677
|
-
/**
|
|
1678
|
-
* @param {?} dispatcher
|
|
1679
|
-
* @param {?} actions$
|
|
1680
|
-
* @param {?} reducers$
|
|
1681
|
-
* @param {?} extension
|
|
1682
|
-
* @param {?} scannedActions
|
|
1683
|
-
* @param {?} errorHandler
|
|
1684
|
-
* @param {?} initialState
|
|
1685
|
-
* @param {?} config
|
|
1686
|
-
*/
|
|
1687
1075
|
function StoreDevtools(dispatcher, actions$, reducers$, extension, scannedActions, errorHandler, initialState, config) {
|
|
1688
1076
|
var _this = this;
|
|
1689
|
-
/** @type {?} */
|
|
1690
1077
|
var liftedInitialState = liftInitialState(initialState, config.monitor);
|
|
1691
|
-
/** @type {?} */
|
|
1692
1078
|
var liftReducer = liftReducerWith(initialState, liftedInitialState, errorHandler, config.monitor, config);
|
|
1693
|
-
/** @type {?} */
|
|
1694
1079
|
var liftedAction$ = rxjs.merge(rxjs.merge(actions$.asObservable().pipe(operators.skip(1)), extension.actions$).pipe(operators.map(liftAction)), dispatcher, extension.liftedActions$).pipe(operators.observeOn(rxjs.queueScheduler));
|
|
1695
|
-
/** @type {?} */
|
|
1696
1080
|
var liftedReducer$ = reducers$.pipe(operators.map(liftReducer));
|
|
1697
|
-
/** @type {?} */
|
|
1698
1081
|
var liftedStateSubject = new rxjs.ReplaySubject(1);
|
|
1699
|
-
/** @type {?} */
|
|
1700
1082
|
var liftedStateSubscription = liftedAction$
|
|
1701
|
-
.pipe(operators.withLatestFrom(liftedReducer$), operators.scan((
|
|
1702
|
-
* @param {?} __0
|
|
1703
|
-
* @param {?} __1
|
|
1704
|
-
* @return {?}
|
|
1705
|
-
*/function (_a, _b) {
|
|
1083
|
+
.pipe(operators.withLatestFrom(liftedReducer$), operators.scan(function (_a, _b) {
|
|
1706
1084
|
var liftedState = _a.state;
|
|
1707
1085
|
var _c = __read(_b, 2), action = _c[0], reducer = _c[1];
|
|
1708
|
-
/** @type {?} */
|
|
1709
1086
|
var reducedLiftedState = reducer(liftedState, action);
|
|
1710
1087
|
// On full state update
|
|
1711
1088
|
// If we have actions filters, we must filter completely our lifted state to be sync with the extension
|
|
@@ -1715,28 +1092,19 @@
|
|
|
1715
1092
|
// Extension should be sent the sanitized lifted state
|
|
1716
1093
|
extension.notify(action, reducedLiftedState);
|
|
1717
1094
|
return { state: reducedLiftedState, action: action };
|
|
1718
|
-
}
|
|
1719
|
-
.subscribe((
|
|
1720
|
-
* @param {?} __0
|
|
1721
|
-
* @return {?}
|
|
1722
|
-
*/function (_a) {
|
|
1095
|
+
}, { state: liftedInitialState, action: null }))
|
|
1096
|
+
.subscribe(function (_a) {
|
|
1723
1097
|
var state = _a.state, action = _a.action;
|
|
1724
1098
|
liftedStateSubject.next(state);
|
|
1725
1099
|
if (action.type === PERFORM_ACTION) {
|
|
1726
|
-
|
|
1727
|
-
var unliftedAction = (( /** @type {?} */(action))).action;
|
|
1100
|
+
var unliftedAction = action.action;
|
|
1728
1101
|
scannedActions.next(unliftedAction);
|
|
1729
1102
|
}
|
|
1730
|
-
})
|
|
1731
|
-
|
|
1732
|
-
var extensionStartSubscription = extension.start$.subscribe(( /**
|
|
1733
|
-
* @return {?}
|
|
1734
|
-
*/function () {
|
|
1103
|
+
});
|
|
1104
|
+
var extensionStartSubscription = extension.start$.subscribe(function () {
|
|
1735
1105
|
_this.refresh();
|
|
1736
|
-
})
|
|
1737
|
-
|
|
1738
|
-
var liftedState$ = ( /** @type {?} */(liftedStateSubject.asObservable()));
|
|
1739
|
-
/** @type {?} */
|
|
1106
|
+
});
|
|
1107
|
+
var liftedState$ = liftedStateSubject.asObservable();
|
|
1740
1108
|
var state$ = liftedState$.pipe(operators.map(unliftState));
|
|
1741
1109
|
this.extensionStartSubscription = extensionStartSubscription;
|
|
1742
1110
|
this.stateSubscription = liftedStateSubscription;
|
|
@@ -1744,105 +1112,47 @@
|
|
|
1744
1112
|
this.liftedState = liftedState$;
|
|
1745
1113
|
this.state = state$;
|
|
1746
1114
|
}
|
|
1747
|
-
/**
|
|
1748
|
-
* @param {?} action
|
|
1749
|
-
* @return {?}
|
|
1750
|
-
*/
|
|
1751
1115
|
StoreDevtools.prototype.dispatch = function (action) {
|
|
1752
1116
|
this.dispatcher.next(action);
|
|
1753
1117
|
};
|
|
1754
|
-
/**
|
|
1755
|
-
* @param {?} action
|
|
1756
|
-
* @return {?}
|
|
1757
|
-
*/
|
|
1758
1118
|
StoreDevtools.prototype.next = function (action) {
|
|
1759
1119
|
this.dispatcher.next(action);
|
|
1760
1120
|
};
|
|
1761
|
-
/**
|
|
1762
|
-
* @param {?} error
|
|
1763
|
-
* @return {?}
|
|
1764
|
-
*/
|
|
1765
1121
|
StoreDevtools.prototype.error = function (error) { };
|
|
1766
|
-
/**
|
|
1767
|
-
* @return {?}
|
|
1768
|
-
*/
|
|
1769
1122
|
StoreDevtools.prototype.complete = function () { };
|
|
1770
|
-
/**
|
|
1771
|
-
* @param {?} action
|
|
1772
|
-
* @return {?}
|
|
1773
|
-
*/
|
|
1774
1123
|
StoreDevtools.prototype.performAction = function (action) {
|
|
1775
1124
|
this.dispatch(new PerformAction(action, +Date.now()));
|
|
1776
1125
|
};
|
|
1777
|
-
/**
|
|
1778
|
-
* @return {?}
|
|
1779
|
-
*/
|
|
1780
1126
|
StoreDevtools.prototype.refresh = function () {
|
|
1781
1127
|
this.dispatch(new Refresh());
|
|
1782
1128
|
};
|
|
1783
|
-
/**
|
|
1784
|
-
* @return {?}
|
|
1785
|
-
*/
|
|
1786
1129
|
StoreDevtools.prototype.reset = function () {
|
|
1787
1130
|
this.dispatch(new Reset(+Date.now()));
|
|
1788
1131
|
};
|
|
1789
|
-
/**
|
|
1790
|
-
* @return {?}
|
|
1791
|
-
*/
|
|
1792
1132
|
StoreDevtools.prototype.rollback = function () {
|
|
1793
1133
|
this.dispatch(new Rollback(+Date.now()));
|
|
1794
1134
|
};
|
|
1795
|
-
/**
|
|
1796
|
-
* @return {?}
|
|
1797
|
-
*/
|
|
1798
1135
|
StoreDevtools.prototype.commit = function () {
|
|
1799
1136
|
this.dispatch(new Commit(+Date.now()));
|
|
1800
1137
|
};
|
|
1801
|
-
/**
|
|
1802
|
-
* @return {?}
|
|
1803
|
-
*/
|
|
1804
1138
|
StoreDevtools.prototype.sweep = function () {
|
|
1805
1139
|
this.dispatch(new Sweep());
|
|
1806
1140
|
};
|
|
1807
|
-
/**
|
|
1808
|
-
* @param {?} id
|
|
1809
|
-
* @return {?}
|
|
1810
|
-
*/
|
|
1811
1141
|
StoreDevtools.prototype.toggleAction = function (id) {
|
|
1812
1142
|
this.dispatch(new ToggleAction(id));
|
|
1813
1143
|
};
|
|
1814
|
-
/**
|
|
1815
|
-
* @param {?} actionId
|
|
1816
|
-
* @return {?}
|
|
1817
|
-
*/
|
|
1818
1144
|
StoreDevtools.prototype.jumpToAction = function (actionId) {
|
|
1819
1145
|
this.dispatch(new JumpToAction(actionId));
|
|
1820
1146
|
};
|
|
1821
|
-
/**
|
|
1822
|
-
* @param {?} index
|
|
1823
|
-
* @return {?}
|
|
1824
|
-
*/
|
|
1825
1147
|
StoreDevtools.prototype.jumpToState = function (index) {
|
|
1826
1148
|
this.dispatch(new JumpToState(index));
|
|
1827
1149
|
};
|
|
1828
|
-
/**
|
|
1829
|
-
* @param {?} nextLiftedState
|
|
1830
|
-
* @return {?}
|
|
1831
|
-
*/
|
|
1832
1150
|
StoreDevtools.prototype.importState = function (nextLiftedState) {
|
|
1833
1151
|
this.dispatch(new ImportState(nextLiftedState));
|
|
1834
1152
|
};
|
|
1835
|
-
/**
|
|
1836
|
-
* @param {?} status
|
|
1837
|
-
* @return {?}
|
|
1838
|
-
*/
|
|
1839
1153
|
StoreDevtools.prototype.lockChanges = function (status) {
|
|
1840
1154
|
this.dispatch(new LockChanges(status));
|
|
1841
1155
|
};
|
|
1842
|
-
/**
|
|
1843
|
-
* @param {?} status
|
|
1844
|
-
* @return {?}
|
|
1845
|
-
*/
|
|
1846
1156
|
StoreDevtools.prototype.pauseRecording = function (status) {
|
|
1847
1157
|
this.dispatch(new PauseRecording(status));
|
|
1848
1158
|
};
|
|
@@ -1862,68 +1172,27 @@
|
|
|
1862
1172
|
{ type: undefined, decorators: [{ type: core.Inject, args: [store.INITIAL_STATE,] }] },
|
|
1863
1173
|
{ type: StoreDevtoolsConfig, decorators: [{ type: core.Inject, args: [STORE_DEVTOOLS_CONFIG,] }] }
|
|
1864
1174
|
]; };
|
|
1865
|
-
if (false) {
|
|
1866
|
-
/**
|
|
1867
|
-
* @type {?}
|
|
1868
|
-
* @private
|
|
1869
|
-
*/
|
|
1870
|
-
StoreDevtools.prototype.stateSubscription;
|
|
1871
|
-
/**
|
|
1872
|
-
* @type {?}
|
|
1873
|
-
* @private
|
|
1874
|
-
*/
|
|
1875
|
-
StoreDevtools.prototype.extensionStartSubscription;
|
|
1876
|
-
/** @type {?} */
|
|
1877
|
-
StoreDevtools.prototype.dispatcher;
|
|
1878
|
-
/** @type {?} */
|
|
1879
|
-
StoreDevtools.prototype.liftedState;
|
|
1880
|
-
/** @type {?} */
|
|
1881
|
-
StoreDevtools.prototype.state;
|
|
1882
|
-
}
|
|
1883
1175
|
|
|
1884
|
-
/**
|
|
1885
|
-
* @fileoverview added by tsickle
|
|
1886
|
-
* Generated from: src/instrument.ts
|
|
1887
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1888
|
-
*/
|
|
1889
|
-
/** @type {?} */
|
|
1890
1176
|
var IS_EXTENSION_OR_MONITOR_PRESENT = new core.InjectionToken('@ngrx/store-devtools Is Devtools Extension or Monitor Present');
|
|
1891
|
-
/**
|
|
1892
|
-
* @param {?} extension
|
|
1893
|
-
* @param {?} config
|
|
1894
|
-
* @return {?}
|
|
1895
|
-
*/
|
|
1896
1177
|
function createIsExtensionOrMonitorPresent(extension, config) {
|
|
1897
1178
|
return Boolean(extension) || config.monitor !== noMonitor;
|
|
1898
1179
|
}
|
|
1899
|
-
/**
|
|
1900
|
-
* @return {?}
|
|
1901
|
-
*/
|
|
1902
1180
|
function createReduxDevtoolsExtension() {
|
|
1903
|
-
/** @type {?} */
|
|
1904
1181
|
var extensionKey = '__REDUX_DEVTOOLS_EXTENSION__';
|
|
1905
1182
|
if (typeof window === 'object' &&
|
|
1906
|
-
typeof
|
|
1907
|
-
return
|
|
1183
|
+
typeof window[extensionKey] !== 'undefined') {
|
|
1184
|
+
return window[extensionKey];
|
|
1908
1185
|
}
|
|
1909
1186
|
else {
|
|
1910
1187
|
return null;
|
|
1911
1188
|
}
|
|
1912
1189
|
}
|
|
1913
|
-
/**
|
|
1914
|
-
* @param {?} devtools
|
|
1915
|
-
* @return {?}
|
|
1916
|
-
*/
|
|
1917
1190
|
function createStateObservable(devtools) {
|
|
1918
1191
|
return devtools.state;
|
|
1919
1192
|
}
|
|
1920
1193
|
var StoreDevtoolsModule = /** @class */ (function () {
|
|
1921
1194
|
function StoreDevtoolsModule() {
|
|
1922
1195
|
}
|
|
1923
|
-
/**
|
|
1924
|
-
* @param {?=} options
|
|
1925
|
-
* @return {?}
|
|
1926
|
-
*/
|
|
1927
1196
|
StoreDevtoolsModule.instrument = function (options) {
|
|
1928
1197
|
if (options === void 0) { options = {}; }
|
|
1929
1198
|
return {
|
|
@@ -1969,27 +1238,13 @@
|
|
|
1969
1238
|
];
|
|
1970
1239
|
|
|
1971
1240
|
/**
|
|
1972
|
-
*
|
|
1973
|
-
*
|
|
1974
|
-
*
|
|
1975
|
-
*/
|
|
1976
|
-
|
|
1977
|
-
/**
|
|
1978
|
-
* @fileoverview added by tsickle
|
|
1979
|
-
* Generated from: public_api.ts
|
|
1980
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1981
|
-
*/
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
* @fileoverview added by tsickle
|
|
1985
|
-
* Generated from: index.ts
|
|
1986
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1241
|
+
* DO NOT EDIT
|
|
1242
|
+
*
|
|
1243
|
+
* This file is automatically generated at build
|
|
1987
1244
|
*/
|
|
1988
1245
|
|
|
1989
1246
|
/**
|
|
1990
|
-
*
|
|
1991
|
-
* Generated from: ngrx-store-devtools.ts
|
|
1992
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1247
|
+
* Generated bundle index. Do not edit.
|
|
1993
1248
|
*/
|
|
1994
1249
|
|
|
1995
1250
|
exports.INITIAL_OPTIONS = INITIAL_OPTIONS;
|