@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
|
@@ -3,84 +3,18 @@ import { ActionsSubject, UPDATE, INIT, ReducerObservable, ScannedActionsSubject,
|
|
|
3
3
|
import { EMPTY, Observable, of, merge, queueScheduler, ReplaySubject } from 'rxjs';
|
|
4
4
|
import { share, filter, map, concatMap, timeout, debounceTime, catchError, take, takeUntil, switchMap, skip, observeOn, withLatestFrom, scan } from 'rxjs/operators';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @fileoverview added by tsickle
|
|
8
|
-
* Generated from: src/config.ts
|
|
9
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* @record
|
|
13
|
-
*/
|
|
14
|
-
function DevToolsFeatureOptions() { }
|
|
15
|
-
if (false) {
|
|
16
|
-
/** @type {?|undefined} */
|
|
17
|
-
DevToolsFeatureOptions.prototype.pause;
|
|
18
|
-
/** @type {?|undefined} */
|
|
19
|
-
DevToolsFeatureOptions.prototype.lock;
|
|
20
|
-
/** @type {?|undefined} */
|
|
21
|
-
DevToolsFeatureOptions.prototype.persist;
|
|
22
|
-
/** @type {?|undefined} */
|
|
23
|
-
DevToolsFeatureOptions.prototype.export;
|
|
24
|
-
/** @type {?|undefined} */
|
|
25
|
-
DevToolsFeatureOptions.prototype.import;
|
|
26
|
-
/** @type {?|undefined} */
|
|
27
|
-
DevToolsFeatureOptions.prototype.jump;
|
|
28
|
-
/** @type {?|undefined} */
|
|
29
|
-
DevToolsFeatureOptions.prototype.skip;
|
|
30
|
-
/** @type {?|undefined} */
|
|
31
|
-
DevToolsFeatureOptions.prototype.reorder;
|
|
32
|
-
/** @type {?|undefined} */
|
|
33
|
-
DevToolsFeatureOptions.prototype.dispatch;
|
|
34
|
-
/** @type {?|undefined} */
|
|
35
|
-
DevToolsFeatureOptions.prototype.test;
|
|
36
|
-
}
|
|
37
6
|
class StoreDevtoolsConfig {
|
|
38
7
|
constructor() {
|
|
39
8
|
this.maxAge = false;
|
|
40
9
|
}
|
|
41
10
|
}
|
|
42
|
-
if (false) {
|
|
43
|
-
/** @type {?} */
|
|
44
|
-
StoreDevtoolsConfig.prototype.maxAge;
|
|
45
|
-
/** @type {?} */
|
|
46
|
-
StoreDevtoolsConfig.prototype.monitor;
|
|
47
|
-
/** @type {?} */
|
|
48
|
-
StoreDevtoolsConfig.prototype.actionSanitizer;
|
|
49
|
-
/** @type {?} */
|
|
50
|
-
StoreDevtoolsConfig.prototype.stateSanitizer;
|
|
51
|
-
/** @type {?} */
|
|
52
|
-
StoreDevtoolsConfig.prototype.name;
|
|
53
|
-
/** @type {?} */
|
|
54
|
-
StoreDevtoolsConfig.prototype.serialize;
|
|
55
|
-
/** @type {?} */
|
|
56
|
-
StoreDevtoolsConfig.prototype.logOnly;
|
|
57
|
-
/** @type {?} */
|
|
58
|
-
StoreDevtoolsConfig.prototype.features;
|
|
59
|
-
/** @type {?} */
|
|
60
|
-
StoreDevtoolsConfig.prototype.actionsBlocklist;
|
|
61
|
-
/** @type {?} */
|
|
62
|
-
StoreDevtoolsConfig.prototype.actionsSafelist;
|
|
63
|
-
/** @type {?} */
|
|
64
|
-
StoreDevtoolsConfig.prototype.predicate;
|
|
65
|
-
}
|
|
66
|
-
/** @type {?} */
|
|
67
11
|
const STORE_DEVTOOLS_CONFIG = new InjectionToken('@ngrx/store-devtools Options');
|
|
68
|
-
/** @type {?} */
|
|
69
12
|
const INITIAL_OPTIONS = new InjectionToken('@ngrx/store-devtools Initial Config');
|
|
70
|
-
/**
|
|
71
|
-
* @return {?}
|
|
72
|
-
*/
|
|
73
13
|
function noMonitor() {
|
|
74
14
|
return null;
|
|
75
15
|
}
|
|
76
|
-
/** @type {?} */
|
|
77
16
|
const DEFAULT_NAME = 'NgRx Store DevTools';
|
|
78
|
-
/**
|
|
79
|
-
* @param {?} _options
|
|
80
|
-
* @return {?}
|
|
81
|
-
*/
|
|
82
17
|
function createConfig(_options) {
|
|
83
|
-
/** @type {?} */
|
|
84
18
|
const DEFAULT_OPTIONS = {
|
|
85
19
|
maxAge: false,
|
|
86
20
|
monitor: noMonitor,
|
|
@@ -93,35 +27,22 @@ function createConfig(_options) {
|
|
|
93
27
|
// options like "lock" which might otherwise not show up.
|
|
94
28
|
features: {
|
|
95
29
|
pause: true,
|
|
96
|
-
// start/pause recording of dispatched actions
|
|
97
30
|
lock: true,
|
|
98
|
-
// lock/unlock dispatching actions and side effects
|
|
99
31
|
persist: true,
|
|
100
|
-
// persist states on page reloading
|
|
101
32
|
export: true,
|
|
102
|
-
// export history of actions in a file
|
|
103
33
|
import: 'custom',
|
|
104
|
-
// import history of actions from a file
|
|
105
34
|
jump: true,
|
|
106
|
-
// jump back and forth (time travelling)
|
|
107
35
|
skip: true,
|
|
108
|
-
// skip (cancel) actions
|
|
109
36
|
reorder: true,
|
|
110
|
-
// drag and drop actions in the history list
|
|
111
37
|
dispatch: true,
|
|
112
|
-
// dispatch custom actions or action creators
|
|
113
38
|
test: true,
|
|
114
39
|
},
|
|
115
40
|
};
|
|
116
|
-
/** @type {?} */
|
|
117
41
|
let options = typeof _options === 'function' ? _options() : _options;
|
|
118
|
-
/** @type {?} */
|
|
119
42
|
const logOnly = options.logOnly
|
|
120
43
|
? { pause: true, export: true, test: true }
|
|
121
44
|
: false;
|
|
122
|
-
/** @type {?} */
|
|
123
45
|
const features = options.features || logOnly || DEFAULT_OPTIONS.features;
|
|
124
|
-
/** @type {?} */
|
|
125
46
|
const config = Object.assign({}, DEFAULT_OPTIONS, { features }, options);
|
|
126
47
|
if (config.maxAge && config.maxAge < 2) {
|
|
127
48
|
throw new Error(`Devtools 'maxAge' cannot be less than 2, got ${config.maxAge}`);
|
|
@@ -129,42 +50,20 @@ function createConfig(_options) {
|
|
|
129
50
|
return config;
|
|
130
51
|
}
|
|
131
52
|
|
|
132
|
-
/**
|
|
133
|
-
* @fileoverview added by tsickle
|
|
134
|
-
* Generated from: src/actions.ts
|
|
135
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
136
|
-
*/
|
|
137
|
-
/** @type {?} */
|
|
138
53
|
const PERFORM_ACTION = 'PERFORM_ACTION';
|
|
139
|
-
/** @type {?} */
|
|
140
54
|
const REFRESH = 'REFRESH';
|
|
141
|
-
/** @type {?} */
|
|
142
55
|
const RESET = 'RESET';
|
|
143
|
-
/** @type {?} */
|
|
144
56
|
const ROLLBACK = 'ROLLBACK';
|
|
145
|
-
/** @type {?} */
|
|
146
57
|
const COMMIT = 'COMMIT';
|
|
147
|
-
/** @type {?} */
|
|
148
58
|
const SWEEP = 'SWEEP';
|
|
149
|
-
/** @type {?} */
|
|
150
59
|
const TOGGLE_ACTION = 'TOGGLE_ACTION';
|
|
151
|
-
/** @type {?} */
|
|
152
60
|
const SET_ACTIONS_ACTIVE = 'SET_ACTIONS_ACTIVE';
|
|
153
|
-
/** @type {?} */
|
|
154
61
|
const JUMP_TO_STATE = 'JUMP_TO_STATE';
|
|
155
|
-
/** @type {?} */
|
|
156
62
|
const JUMP_TO_ACTION = 'JUMP_TO_ACTION';
|
|
157
|
-
/** @type {?} */
|
|
158
63
|
const IMPORT_STATE = 'IMPORT_STATE';
|
|
159
|
-
/** @type {?} */
|
|
160
64
|
const LOCK_CHANGES = 'LOCK_CHANGES';
|
|
161
|
-
/** @type {?} */
|
|
162
65
|
const PAUSE_RECORDING = 'PAUSE_RECORDING';
|
|
163
66
|
class PerformAction {
|
|
164
|
-
/**
|
|
165
|
-
* @param {?} action
|
|
166
|
-
* @param {?} timestamp
|
|
167
|
-
*/
|
|
168
67
|
constructor(action, timestamp) {
|
|
169
68
|
this.action = action;
|
|
170
69
|
this.timestamp = timestamp;
|
|
@@ -175,98 +74,41 @@ class PerformAction {
|
|
|
175
74
|
}
|
|
176
75
|
}
|
|
177
76
|
}
|
|
178
|
-
if (false) {
|
|
179
|
-
/** @type {?} */
|
|
180
|
-
PerformAction.prototype.type;
|
|
181
|
-
/** @type {?} */
|
|
182
|
-
PerformAction.prototype.action;
|
|
183
|
-
/** @type {?} */
|
|
184
|
-
PerformAction.prototype.timestamp;
|
|
185
|
-
}
|
|
186
77
|
class Refresh {
|
|
187
78
|
constructor() {
|
|
188
79
|
this.type = REFRESH;
|
|
189
80
|
}
|
|
190
81
|
}
|
|
191
|
-
if (false) {
|
|
192
|
-
/** @type {?} */
|
|
193
|
-
Refresh.prototype.type;
|
|
194
|
-
}
|
|
195
82
|
class Reset {
|
|
196
|
-
/**
|
|
197
|
-
* @param {?} timestamp
|
|
198
|
-
*/
|
|
199
83
|
constructor(timestamp) {
|
|
200
84
|
this.timestamp = timestamp;
|
|
201
85
|
this.type = RESET;
|
|
202
86
|
}
|
|
203
87
|
}
|
|
204
|
-
if (false) {
|
|
205
|
-
/** @type {?} */
|
|
206
|
-
Reset.prototype.type;
|
|
207
|
-
/** @type {?} */
|
|
208
|
-
Reset.prototype.timestamp;
|
|
209
|
-
}
|
|
210
88
|
class Rollback {
|
|
211
|
-
/**
|
|
212
|
-
* @param {?} timestamp
|
|
213
|
-
*/
|
|
214
89
|
constructor(timestamp) {
|
|
215
90
|
this.timestamp = timestamp;
|
|
216
91
|
this.type = ROLLBACK;
|
|
217
92
|
}
|
|
218
93
|
}
|
|
219
|
-
if (false) {
|
|
220
|
-
/** @type {?} */
|
|
221
|
-
Rollback.prototype.type;
|
|
222
|
-
/** @type {?} */
|
|
223
|
-
Rollback.prototype.timestamp;
|
|
224
|
-
}
|
|
225
94
|
class Commit {
|
|
226
|
-
/**
|
|
227
|
-
* @param {?} timestamp
|
|
228
|
-
*/
|
|
229
95
|
constructor(timestamp) {
|
|
230
96
|
this.timestamp = timestamp;
|
|
231
97
|
this.type = COMMIT;
|
|
232
98
|
}
|
|
233
99
|
}
|
|
234
|
-
if (false) {
|
|
235
|
-
/** @type {?} */
|
|
236
|
-
Commit.prototype.type;
|
|
237
|
-
/** @type {?} */
|
|
238
|
-
Commit.prototype.timestamp;
|
|
239
|
-
}
|
|
240
100
|
class Sweep {
|
|
241
101
|
constructor() {
|
|
242
102
|
this.type = SWEEP;
|
|
243
103
|
}
|
|
244
104
|
}
|
|
245
|
-
if (false) {
|
|
246
|
-
/** @type {?} */
|
|
247
|
-
Sweep.prototype.type;
|
|
248
|
-
}
|
|
249
105
|
class ToggleAction {
|
|
250
|
-
/**
|
|
251
|
-
* @param {?} id
|
|
252
|
-
*/
|
|
253
106
|
constructor(id) {
|
|
254
107
|
this.id = id;
|
|
255
108
|
this.type = TOGGLE_ACTION;
|
|
256
109
|
}
|
|
257
110
|
}
|
|
258
|
-
if (false) {
|
|
259
|
-
/** @type {?} */
|
|
260
|
-
ToggleAction.prototype.type;
|
|
261
|
-
/** @type {?} */
|
|
262
|
-
ToggleAction.prototype.id;
|
|
263
|
-
}
|
|
264
111
|
class SetActionsActive {
|
|
265
|
-
/**
|
|
266
|
-
* @param {?} start
|
|
267
|
-
* @param {?} end
|
|
268
|
-
* @param {?=} active
|
|
269
|
-
*/
|
|
270
112
|
constructor(start, end, active = true) {
|
|
271
113
|
this.start = start;
|
|
272
114
|
this.end = end;
|
|
@@ -274,124 +116,48 @@ class SetActionsActive {
|
|
|
274
116
|
this.type = SET_ACTIONS_ACTIVE;
|
|
275
117
|
}
|
|
276
118
|
}
|
|
277
|
-
if (false) {
|
|
278
|
-
/** @type {?} */
|
|
279
|
-
SetActionsActive.prototype.type;
|
|
280
|
-
/** @type {?} */
|
|
281
|
-
SetActionsActive.prototype.start;
|
|
282
|
-
/** @type {?} */
|
|
283
|
-
SetActionsActive.prototype.end;
|
|
284
|
-
/** @type {?} */
|
|
285
|
-
SetActionsActive.prototype.active;
|
|
286
|
-
}
|
|
287
119
|
class JumpToState {
|
|
288
|
-
/**
|
|
289
|
-
* @param {?} index
|
|
290
|
-
*/
|
|
291
120
|
constructor(index) {
|
|
292
121
|
this.index = index;
|
|
293
122
|
this.type = JUMP_TO_STATE;
|
|
294
123
|
}
|
|
295
124
|
}
|
|
296
|
-
if (false) {
|
|
297
|
-
/** @type {?} */
|
|
298
|
-
JumpToState.prototype.type;
|
|
299
|
-
/** @type {?} */
|
|
300
|
-
JumpToState.prototype.index;
|
|
301
|
-
}
|
|
302
125
|
class JumpToAction {
|
|
303
|
-
/**
|
|
304
|
-
* @param {?} actionId
|
|
305
|
-
*/
|
|
306
126
|
constructor(actionId) {
|
|
307
127
|
this.actionId = actionId;
|
|
308
128
|
this.type = JUMP_TO_ACTION;
|
|
309
129
|
}
|
|
310
130
|
}
|
|
311
|
-
if (false) {
|
|
312
|
-
/** @type {?} */
|
|
313
|
-
JumpToAction.prototype.type;
|
|
314
|
-
/** @type {?} */
|
|
315
|
-
JumpToAction.prototype.actionId;
|
|
316
|
-
}
|
|
317
131
|
class ImportState {
|
|
318
|
-
/**
|
|
319
|
-
* @param {?} nextLiftedState
|
|
320
|
-
*/
|
|
321
132
|
constructor(nextLiftedState) {
|
|
322
133
|
this.nextLiftedState = nextLiftedState;
|
|
323
134
|
this.type = IMPORT_STATE;
|
|
324
135
|
}
|
|
325
136
|
}
|
|
326
|
-
if (false) {
|
|
327
|
-
/** @type {?} */
|
|
328
|
-
ImportState.prototype.type;
|
|
329
|
-
/** @type {?} */
|
|
330
|
-
ImportState.prototype.nextLiftedState;
|
|
331
|
-
}
|
|
332
137
|
class LockChanges {
|
|
333
|
-
/**
|
|
334
|
-
* @param {?} status
|
|
335
|
-
*/
|
|
336
138
|
constructor(status) {
|
|
337
139
|
this.status = status;
|
|
338
140
|
this.type = LOCK_CHANGES;
|
|
339
141
|
}
|
|
340
142
|
}
|
|
341
|
-
if (false) {
|
|
342
|
-
/** @type {?} */
|
|
343
|
-
LockChanges.prototype.type;
|
|
344
|
-
/** @type {?} */
|
|
345
|
-
LockChanges.prototype.status;
|
|
346
|
-
}
|
|
347
143
|
class PauseRecording {
|
|
348
|
-
/**
|
|
349
|
-
* @param {?} status
|
|
350
|
-
*/
|
|
351
144
|
constructor(status) {
|
|
352
145
|
this.status = status;
|
|
353
146
|
this.type = PAUSE_RECORDING;
|
|
354
147
|
}
|
|
355
148
|
}
|
|
356
|
-
if (false) {
|
|
357
|
-
/** @type {?} */
|
|
358
|
-
PauseRecording.prototype.type;
|
|
359
|
-
/** @type {?} */
|
|
360
|
-
PauseRecording.prototype.status;
|
|
361
|
-
}
|
|
362
149
|
|
|
363
|
-
/**
|
|
364
|
-
* @fileoverview added by tsickle
|
|
365
|
-
* Generated from: src/devtools-dispatcher.ts
|
|
366
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
367
|
-
*/
|
|
368
150
|
class DevtoolsDispatcher extends ActionsSubject {
|
|
369
151
|
}
|
|
370
152
|
DevtoolsDispatcher.decorators = [
|
|
371
153
|
{ type: Injectable }
|
|
372
154
|
];
|
|
373
155
|
|
|
374
|
-
/**
|
|
375
|
-
* @fileoverview added by tsickle
|
|
376
|
-
* Generated from: src/utils.ts
|
|
377
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
378
|
-
*/
|
|
379
|
-
/**
|
|
380
|
-
* @param {?} first
|
|
381
|
-
* @param {?} second
|
|
382
|
-
* @return {?}
|
|
383
|
-
*/
|
|
384
156
|
function difference(first, second) {
|
|
385
|
-
return first.filter((
|
|
386
|
-
* @param {?} item
|
|
387
|
-
* @return {?}
|
|
388
|
-
*/
|
|
389
|
-
(item) => second.indexOf(item) < 0));
|
|
157
|
+
return first.filter((item) => second.indexOf(item) < 0);
|
|
390
158
|
}
|
|
391
159
|
/**
|
|
392
160
|
* Provides an app's view into the state of the lifted store.
|
|
393
|
-
* @param {?} liftedState
|
|
394
|
-
* @return {?}
|
|
395
161
|
*/
|
|
396
162
|
function unliftState(liftedState) {
|
|
397
163
|
const { computedStates, currentStateIndex } = liftedState;
|
|
@@ -406,107 +172,60 @@ function unliftState(liftedState) {
|
|
|
406
172
|
const { state } = computedStates[currentStateIndex];
|
|
407
173
|
return state;
|
|
408
174
|
}
|
|
409
|
-
/**
|
|
410
|
-
* @param {?} liftedState
|
|
411
|
-
* @return {?}
|
|
412
|
-
*/
|
|
413
175
|
function unliftAction(liftedState) {
|
|
414
176
|
return liftedState.actionsById[liftedState.nextActionId - 1];
|
|
415
177
|
}
|
|
416
178
|
/**
|
|
417
179
|
* Lifts an app's action into an action on the lifted store.
|
|
418
|
-
* @param {?} action
|
|
419
|
-
* @return {?}
|
|
420
180
|
*/
|
|
421
181
|
function liftAction(action) {
|
|
422
182
|
return new PerformAction(action, +Date.now());
|
|
423
183
|
}
|
|
424
184
|
/**
|
|
425
185
|
* Sanitizes given actions with given function.
|
|
426
|
-
* @param {?} actionSanitizer
|
|
427
|
-
* @param {?} actions
|
|
428
|
-
* @return {?}
|
|
429
186
|
*/
|
|
430
187
|
function sanitizeActions(actionSanitizer, actions) {
|
|
431
|
-
return Object.keys(actions).reduce((
|
|
432
|
-
* @param {?} sanitizedActions
|
|
433
|
-
* @param {?} actionIdx
|
|
434
|
-
* @return {?}
|
|
435
|
-
*/
|
|
436
|
-
(sanitizedActions, actionIdx) => {
|
|
437
|
-
/** @type {?} */
|
|
188
|
+
return Object.keys(actions).reduce((sanitizedActions, actionIdx) => {
|
|
438
189
|
const idx = Number(actionIdx);
|
|
439
190
|
sanitizedActions[idx] = sanitizeAction(actionSanitizer, actions[idx], idx);
|
|
440
191
|
return sanitizedActions;
|
|
441
|
-
}
|
|
192
|
+
}, {});
|
|
442
193
|
}
|
|
443
194
|
/**
|
|
444
195
|
* Sanitizes given action with given function.
|
|
445
|
-
* @param {?} actionSanitizer
|
|
446
|
-
* @param {?} action
|
|
447
|
-
* @param {?} actionIdx
|
|
448
|
-
* @return {?}
|
|
449
196
|
*/
|
|
450
197
|
function sanitizeAction(actionSanitizer, action, actionIdx) {
|
|
451
198
|
return Object.assign(Object.assign({}, action), { action: actionSanitizer(action.action, actionIdx) });
|
|
452
199
|
}
|
|
453
200
|
/**
|
|
454
201
|
* Sanitizes given states with given function.
|
|
455
|
-
* @param {?} stateSanitizer
|
|
456
|
-
* @param {?} states
|
|
457
|
-
* @return {?}
|
|
458
202
|
*/
|
|
459
203
|
function sanitizeStates(stateSanitizer, states) {
|
|
460
|
-
return states.map((
|
|
461
|
-
* @param {?} computedState
|
|
462
|
-
* @param {?} idx
|
|
463
|
-
* @return {?}
|
|
464
|
-
*/
|
|
465
|
-
(computedState, idx) => ({
|
|
204
|
+
return states.map((computedState, idx) => ({
|
|
466
205
|
state: sanitizeState(stateSanitizer, computedState.state, idx),
|
|
467
206
|
error: computedState.error,
|
|
468
|
-
}))
|
|
207
|
+
}));
|
|
469
208
|
}
|
|
470
209
|
/**
|
|
471
210
|
* Sanitizes given state with given function.
|
|
472
|
-
* @param {?} stateSanitizer
|
|
473
|
-
* @param {?} state
|
|
474
|
-
* @param {?} stateIdx
|
|
475
|
-
* @return {?}
|
|
476
211
|
*/
|
|
477
212
|
function sanitizeState(stateSanitizer, state, stateIdx) {
|
|
478
213
|
return stateSanitizer(state, stateIdx);
|
|
479
214
|
}
|
|
480
215
|
/**
|
|
481
216
|
* Read the config and tell if actions should be filtered
|
|
482
|
-
* @param {?} config
|
|
483
|
-
* @return {?}
|
|
484
217
|
*/
|
|
485
218
|
function shouldFilterActions(config) {
|
|
486
219
|
return config.predicate || config.actionsSafelist || config.actionsBlocklist;
|
|
487
220
|
}
|
|
488
221
|
/**
|
|
489
222
|
* Return a full filtered lifted state
|
|
490
|
-
* @param {?} liftedState
|
|
491
|
-
* @param {?=} predicate
|
|
492
|
-
* @param {?=} safelist
|
|
493
|
-
* @param {?=} blocklist
|
|
494
|
-
* @return {?}
|
|
495
223
|
*/
|
|
496
224
|
function filterLiftedState(liftedState, predicate, safelist, blocklist) {
|
|
497
|
-
/** @type {?} */
|
|
498
225
|
const filteredStagedActionIds = [];
|
|
499
|
-
/** @type {?} */
|
|
500
226
|
const filteredActionsById = {};
|
|
501
|
-
/** @type {?} */
|
|
502
227
|
const filteredComputedStates = [];
|
|
503
|
-
liftedState.stagedActionIds.forEach((
|
|
504
|
-
* @param {?} id
|
|
505
|
-
* @param {?} idx
|
|
506
|
-
* @return {?}
|
|
507
|
-
*/
|
|
508
|
-
(id, idx) => {
|
|
509
|
-
/** @type {?} */
|
|
228
|
+
liftedState.stagedActionIds.forEach((id, idx) => {
|
|
510
229
|
const liftedAction = liftedState.actionsById[id];
|
|
511
230
|
if (!liftedAction)
|
|
512
231
|
return;
|
|
@@ -517,141 +236,42 @@ function filterLiftedState(liftedState, predicate, safelist, blocklist) {
|
|
|
517
236
|
filteredActionsById[id] = liftedAction;
|
|
518
237
|
filteredStagedActionIds.push(id);
|
|
519
238
|
filteredComputedStates.push(liftedState.computedStates[idx]);
|
|
520
|
-
})
|
|
239
|
+
});
|
|
521
240
|
return Object.assign(Object.assign({}, liftedState), { stagedActionIds: filteredStagedActionIds, actionsById: filteredActionsById, computedStates: filteredComputedStates });
|
|
522
241
|
}
|
|
523
242
|
/**
|
|
524
243
|
* Return true is the action should be ignored
|
|
525
|
-
* @param {?} state
|
|
526
|
-
* @param {?} action
|
|
527
|
-
* @param {?=} predicate
|
|
528
|
-
* @param {?=} safelist
|
|
529
|
-
* @param {?=} blockedlist
|
|
530
|
-
* @return {?}
|
|
531
244
|
*/
|
|
532
245
|
function isActionFiltered(state, action, predicate, safelist, blockedlist) {
|
|
533
|
-
/** @type {?} */
|
|
534
246
|
const predicateMatch = predicate && !predicate(state, action.action);
|
|
535
|
-
/** @type {?} */
|
|
536
247
|
const safelistMatch = safelist &&
|
|
537
|
-
!action.action.type.match(safelist.map((
|
|
538
|
-
* @param {?} s
|
|
539
|
-
* @return {?}
|
|
540
|
-
*/
|
|
541
|
-
(s) => escapeRegExp(s))).join('|'));
|
|
542
|
-
/** @type {?} */
|
|
248
|
+
!action.action.type.match(safelist.map((s) => escapeRegExp(s)).join('|'));
|
|
543
249
|
const blocklistMatch = blockedlist &&
|
|
544
|
-
action.action.type.match(blockedlist.map((
|
|
545
|
-
* @param {?} s
|
|
546
|
-
* @return {?}
|
|
547
|
-
*/
|
|
548
|
-
(s) => escapeRegExp(s))).join('|'));
|
|
250
|
+
action.action.type.match(blockedlist.map((s) => escapeRegExp(s)).join('|'));
|
|
549
251
|
return predicateMatch || safelistMatch || blocklistMatch;
|
|
550
252
|
}
|
|
551
253
|
/**
|
|
552
254
|
* Return string with escaped RegExp special characters
|
|
553
255
|
* https://stackoverflow.com/a/6969486/1337347
|
|
554
|
-
* @param {?} s
|
|
555
|
-
* @return {?}
|
|
556
256
|
*/
|
|
557
257
|
function escapeRegExp(s) {
|
|
558
258
|
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
559
259
|
}
|
|
560
260
|
|
|
561
|
-
/**
|
|
562
|
-
* @fileoverview added by tsickle
|
|
563
|
-
* Generated from: src/extension.ts
|
|
564
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
565
|
-
*/
|
|
566
|
-
/** @type {?} */
|
|
567
261
|
const ExtensionActionTypes = {
|
|
568
262
|
START: 'START',
|
|
569
263
|
DISPATCH: 'DISPATCH',
|
|
570
264
|
STOP: 'STOP',
|
|
571
265
|
ACTION: 'ACTION',
|
|
572
266
|
};
|
|
573
|
-
/** @type {?} */
|
|
574
267
|
const REDUX_DEVTOOLS_EXTENSION = new InjectionToken('@ngrx/store-devtools Redux Devtools Extension');
|
|
575
|
-
/**
|
|
576
|
-
* @record
|
|
577
|
-
*/
|
|
578
|
-
function ReduxDevtoolsExtensionConnection() { }
|
|
579
|
-
if (false) {
|
|
580
|
-
/**
|
|
581
|
-
* @param {?} listener
|
|
582
|
-
* @return {?}
|
|
583
|
-
*/
|
|
584
|
-
ReduxDevtoolsExtensionConnection.prototype.subscribe = function (listener) { };
|
|
585
|
-
/**
|
|
586
|
-
* @return {?}
|
|
587
|
-
*/
|
|
588
|
-
ReduxDevtoolsExtensionConnection.prototype.unsubscribe = function () { };
|
|
589
|
-
/**
|
|
590
|
-
* @param {?} action
|
|
591
|
-
* @param {?} state
|
|
592
|
-
* @return {?}
|
|
593
|
-
*/
|
|
594
|
-
ReduxDevtoolsExtensionConnection.prototype.send = function (action, state) { };
|
|
595
|
-
/**
|
|
596
|
-
* @param {?=} state
|
|
597
|
-
* @return {?}
|
|
598
|
-
*/
|
|
599
|
-
ReduxDevtoolsExtensionConnection.prototype.init = function (state) { };
|
|
600
|
-
/**
|
|
601
|
-
* @param {?} anyErr
|
|
602
|
-
* @return {?}
|
|
603
|
-
*/
|
|
604
|
-
ReduxDevtoolsExtensionConnection.prototype.error = function (anyErr) { };
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* @record
|
|
608
|
-
*/
|
|
609
|
-
function ReduxDevtoolsExtensionConfig() { }
|
|
610
|
-
if (false) {
|
|
611
|
-
/** @type {?|undefined} */
|
|
612
|
-
ReduxDevtoolsExtensionConfig.prototype.features;
|
|
613
|
-
/** @type {?} */
|
|
614
|
-
ReduxDevtoolsExtensionConfig.prototype.name;
|
|
615
|
-
/** @type {?|undefined} */
|
|
616
|
-
ReduxDevtoolsExtensionConfig.prototype.maxAge;
|
|
617
|
-
/** @type {?|undefined} */
|
|
618
|
-
ReduxDevtoolsExtensionConfig.prototype.serialize;
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* @record
|
|
622
|
-
*/
|
|
623
|
-
function ReduxDevtoolsExtension() { }
|
|
624
|
-
if (false) {
|
|
625
|
-
/**
|
|
626
|
-
* @param {?} options
|
|
627
|
-
* @return {?}
|
|
628
|
-
*/
|
|
629
|
-
ReduxDevtoolsExtension.prototype.connect = function (options) { };
|
|
630
|
-
/**
|
|
631
|
-
* @param {?} action
|
|
632
|
-
* @param {?} state
|
|
633
|
-
* @param {?} options
|
|
634
|
-
* @return {?}
|
|
635
|
-
*/
|
|
636
|
-
ReduxDevtoolsExtension.prototype.send = function (action, state, options) { };
|
|
637
|
-
}
|
|
638
268
|
class DevtoolsExtension {
|
|
639
|
-
/**
|
|
640
|
-
* @param {?} devtoolsExtension
|
|
641
|
-
* @param {?} config
|
|
642
|
-
* @param {?} dispatcher
|
|
643
|
-
*/
|
|
644
269
|
constructor(devtoolsExtension, config, dispatcher) {
|
|
645
270
|
this.config = config;
|
|
646
271
|
this.dispatcher = dispatcher;
|
|
647
272
|
this.devtoolsExtension = devtoolsExtension;
|
|
648
273
|
this.createActionStreams();
|
|
649
274
|
}
|
|
650
|
-
/**
|
|
651
|
-
* @param {?} action
|
|
652
|
-
* @param {?} state
|
|
653
|
-
* @return {?}
|
|
654
|
-
*/
|
|
655
275
|
notify(action, state) {
|
|
656
276
|
if (!this.devtoolsExtension) {
|
|
657
277
|
return;
|
|
@@ -673,101 +293,50 @@ class DevtoolsExtension {
|
|
|
673
293
|
if (state.isLocked || state.isPaused) {
|
|
674
294
|
return;
|
|
675
295
|
}
|
|
676
|
-
/** @type {?} */
|
|
677
296
|
const currentState = unliftState(state);
|
|
678
297
|
if (shouldFilterActions(this.config) &&
|
|
679
298
|
isActionFiltered(currentState, action, this.config.predicate, this.config.actionsSafelist, this.config.actionsBlocklist)) {
|
|
680
299
|
return;
|
|
681
300
|
}
|
|
682
|
-
/** @type {?} */
|
|
683
301
|
const sanitizedState = this.config.stateSanitizer
|
|
684
302
|
? sanitizeState(this.config.stateSanitizer, currentState, state.currentStateIndex)
|
|
685
303
|
: currentState;
|
|
686
|
-
/** @type {?} */
|
|
687
304
|
const sanitizedAction = this.config.actionSanitizer
|
|
688
305
|
? sanitizeAction(this.config.actionSanitizer, action, state.nextActionId)
|
|
689
306
|
: action;
|
|
690
|
-
this.sendToReduxDevtools((
|
|
691
|
-
* @return {?}
|
|
692
|
-
*/
|
|
693
|
-
() => this.extensionConnection.send(sanitizedAction, sanitizedState)));
|
|
307
|
+
this.sendToReduxDevtools(() => this.extensionConnection.send(sanitizedAction, sanitizedState));
|
|
694
308
|
}
|
|
695
309
|
else {
|
|
696
310
|
// Requires full state update
|
|
697
|
-
/** @type {?} */
|
|
698
311
|
const sanitizedLiftedState = Object.assign(Object.assign({}, state), { stagedActionIds: state.stagedActionIds, actionsById: this.config.actionSanitizer
|
|
699
312
|
? sanitizeActions(this.config.actionSanitizer, state.actionsById)
|
|
700
313
|
: state.actionsById, computedStates: this.config.stateSanitizer
|
|
701
314
|
? sanitizeStates(this.config.stateSanitizer, state.computedStates)
|
|
702
315
|
: state.computedStates });
|
|
703
|
-
this.sendToReduxDevtools((
|
|
704
|
-
* @return {?}
|
|
705
|
-
*/
|
|
706
|
-
() => this.devtoolsExtension.send(null, sanitizedLiftedState, this.getExtensionConfig(this.config))));
|
|
316
|
+
this.sendToReduxDevtools(() => this.devtoolsExtension.send(null, sanitizedLiftedState, this.getExtensionConfig(this.config)));
|
|
707
317
|
}
|
|
708
318
|
}
|
|
709
|
-
/**
|
|
710
|
-
* @private
|
|
711
|
-
* @return {?}
|
|
712
|
-
*/
|
|
713
319
|
createChangesObservable() {
|
|
714
320
|
if (!this.devtoolsExtension) {
|
|
715
321
|
return EMPTY;
|
|
716
322
|
}
|
|
717
|
-
return new Observable((
|
|
718
|
-
* @param {?} subscriber
|
|
719
|
-
* @return {?}
|
|
720
|
-
*/
|
|
721
|
-
(subscriber) => {
|
|
722
|
-
/** @type {?} */
|
|
323
|
+
return new Observable((subscriber) => {
|
|
723
324
|
const connection = this.devtoolsExtension.connect(this.getExtensionConfig(this.config));
|
|
724
325
|
this.extensionConnection = connection;
|
|
725
326
|
connection.init();
|
|
726
|
-
connection.subscribe((
|
|
727
|
-
* @param {?} change
|
|
728
|
-
* @return {?}
|
|
729
|
-
*/
|
|
730
|
-
(change) => subscriber.next(change)));
|
|
327
|
+
connection.subscribe((change) => subscriber.next(change));
|
|
731
328
|
return connection.unsubscribe;
|
|
732
|
-
})
|
|
329
|
+
});
|
|
733
330
|
}
|
|
734
|
-
/**
|
|
735
|
-
* @private
|
|
736
|
-
* @return {?}
|
|
737
|
-
*/
|
|
738
331
|
createActionStreams() {
|
|
739
332
|
// Listens to all changes
|
|
740
|
-
/** @type {?} */
|
|
741
333
|
const changes$ = this.createChangesObservable().pipe(share());
|
|
742
334
|
// Listen for the start action
|
|
743
|
-
|
|
744
|
-
const start$ = changes$.pipe(filter((/**
|
|
745
|
-
* @param {?} change
|
|
746
|
-
* @return {?}
|
|
747
|
-
*/
|
|
748
|
-
(change) => change.type === ExtensionActionTypes.START)));
|
|
335
|
+
const start$ = changes$.pipe(filter((change) => change.type === ExtensionActionTypes.START));
|
|
749
336
|
// Listen for the stop action
|
|
750
|
-
|
|
751
|
-
const stop$ = changes$.pipe(filter((/**
|
|
752
|
-
* @param {?} change
|
|
753
|
-
* @return {?}
|
|
754
|
-
*/
|
|
755
|
-
(change) => change.type === ExtensionActionTypes.STOP)));
|
|
337
|
+
const stop$ = changes$.pipe(filter((change) => change.type === ExtensionActionTypes.STOP));
|
|
756
338
|
// Listen for lifted actions
|
|
757
|
-
|
|
758
|
-
const liftedActions$ = changes$.pipe(filter((/**
|
|
759
|
-
* @param {?} change
|
|
760
|
-
* @return {?}
|
|
761
|
-
*/
|
|
762
|
-
(change) => change.type === ExtensionActionTypes.DISPATCH)), map((/**
|
|
763
|
-
* @param {?} change
|
|
764
|
-
* @return {?}
|
|
765
|
-
*/
|
|
766
|
-
(change) => this.unwrapAction(change.payload))), concatMap((/**
|
|
767
|
-
* @param {?} action
|
|
768
|
-
* @return {?}
|
|
769
|
-
*/
|
|
770
|
-
(action) => {
|
|
339
|
+
const liftedActions$ = changes$.pipe(filter((change) => change.type === ExtensionActionTypes.DISPATCH), map((change) => this.unwrapAction(change.payload)), concatMap((action) => {
|
|
771
340
|
if (action.type === IMPORT_STATE) {
|
|
772
341
|
// State imports may happen in two situations:
|
|
773
342
|
// 1. Explicitly by user
|
|
@@ -777,63 +346,25 @@ class DevtoolsExtension {
|
|
|
777
346
|
// lazy loaded reducers time to instantiate.
|
|
778
347
|
// As soon as there is no UPDATE action within 1 second,
|
|
779
348
|
// it is assumed that all reducers are loaded.
|
|
780
|
-
return this.dispatcher.pipe(filter((
|
|
781
|
-
* @param {?} action
|
|
782
|
-
* @return {?}
|
|
783
|
-
*/
|
|
784
|
-
(action) => action.type === UPDATE)), timeout(1000), debounceTime(1000), map((/**
|
|
785
|
-
* @return {?}
|
|
786
|
-
*/
|
|
787
|
-
() => action)), catchError((/**
|
|
788
|
-
* @return {?}
|
|
789
|
-
*/
|
|
790
|
-
() => of(action))), take(1));
|
|
349
|
+
return this.dispatcher.pipe(filter((action) => action.type === UPDATE), timeout(1000), debounceTime(1000), map(() => action), catchError(() => of(action)), take(1));
|
|
791
350
|
}
|
|
792
351
|
else {
|
|
793
352
|
return of(action);
|
|
794
353
|
}
|
|
795
|
-
}))
|
|
354
|
+
}));
|
|
796
355
|
// Listen for unlifted actions
|
|
797
|
-
|
|
798
|
-
const actions$ = changes$.pipe(filter((/**
|
|
799
|
-
* @param {?} change
|
|
800
|
-
* @return {?}
|
|
801
|
-
*/
|
|
802
|
-
(change) => change.type === ExtensionActionTypes.ACTION)), map((/**
|
|
803
|
-
* @param {?} change
|
|
804
|
-
* @return {?}
|
|
805
|
-
*/
|
|
806
|
-
(change) => this.unwrapAction(change.payload))));
|
|
807
|
-
/** @type {?} */
|
|
356
|
+
const actions$ = changes$.pipe(filter((change) => change.type === ExtensionActionTypes.ACTION), map((change) => this.unwrapAction(change.payload)));
|
|
808
357
|
const actionsUntilStop$ = actions$.pipe(takeUntil(stop$));
|
|
809
|
-
/** @type {?} */
|
|
810
358
|
const liftedUntilStop$ = liftedActions$.pipe(takeUntil(stop$));
|
|
811
359
|
this.start$ = start$.pipe(takeUntil(stop$));
|
|
812
360
|
// Only take the action sources between the start/stop events
|
|
813
|
-
this.actions$ = this.start$.pipe(switchMap((
|
|
814
|
-
|
|
815
|
-
*/
|
|
816
|
-
() => actionsUntilStop$)));
|
|
817
|
-
this.liftedActions$ = this.start$.pipe(switchMap((/**
|
|
818
|
-
* @return {?}
|
|
819
|
-
*/
|
|
820
|
-
() => liftedUntilStop$)));
|
|
361
|
+
this.actions$ = this.start$.pipe(switchMap(() => actionsUntilStop$));
|
|
362
|
+
this.liftedActions$ = this.start$.pipe(switchMap(() => liftedUntilStop$));
|
|
821
363
|
}
|
|
822
|
-
/**
|
|
823
|
-
* @private
|
|
824
|
-
* @param {?} action
|
|
825
|
-
* @return {?}
|
|
826
|
-
*/
|
|
827
364
|
unwrapAction(action) {
|
|
828
365
|
return typeof action === 'string' ? eval(`(${action})`) : action;
|
|
829
366
|
}
|
|
830
|
-
/**
|
|
831
|
-
* @private
|
|
832
|
-
* @param {?} config
|
|
833
|
-
* @return {?}
|
|
834
|
-
*/
|
|
835
367
|
getExtensionConfig(config) {
|
|
836
|
-
/** @type {?} */
|
|
837
368
|
const extensionOptions = {
|
|
838
369
|
name: config.name,
|
|
839
370
|
features: config.features,
|
|
@@ -844,11 +375,6 @@ class DevtoolsExtension {
|
|
|
844
375
|
}
|
|
845
376
|
return extensionOptions;
|
|
846
377
|
}
|
|
847
|
-
/**
|
|
848
|
-
* @private
|
|
849
|
-
* @param {?} send
|
|
850
|
-
* @return {?}
|
|
851
|
-
*/
|
|
852
378
|
sendToReduxDevtools(send) {
|
|
853
379
|
try {
|
|
854
380
|
send();
|
|
@@ -867,104 +393,12 @@ DevtoolsExtension.ctorParameters = () => [
|
|
|
867
393
|
{ type: StoreDevtoolsConfig, decorators: [{ type: Inject, args: [STORE_DEVTOOLS_CONFIG,] }] },
|
|
868
394
|
{ type: DevtoolsDispatcher }
|
|
869
395
|
];
|
|
870
|
-
if (false) {
|
|
871
|
-
/**
|
|
872
|
-
* @type {?}
|
|
873
|
-
* @private
|
|
874
|
-
*/
|
|
875
|
-
DevtoolsExtension.prototype.devtoolsExtension;
|
|
876
|
-
/**
|
|
877
|
-
* @type {?}
|
|
878
|
-
* @private
|
|
879
|
-
*/
|
|
880
|
-
DevtoolsExtension.prototype.extensionConnection;
|
|
881
|
-
/** @type {?} */
|
|
882
|
-
DevtoolsExtension.prototype.liftedActions$;
|
|
883
|
-
/** @type {?} */
|
|
884
|
-
DevtoolsExtension.prototype.actions$;
|
|
885
|
-
/** @type {?} */
|
|
886
|
-
DevtoolsExtension.prototype.start$;
|
|
887
|
-
/**
|
|
888
|
-
* @type {?}
|
|
889
|
-
* @private
|
|
890
|
-
*/
|
|
891
|
-
DevtoolsExtension.prototype.config;
|
|
892
|
-
/**
|
|
893
|
-
* @type {?}
|
|
894
|
-
* @private
|
|
895
|
-
*/
|
|
896
|
-
DevtoolsExtension.prototype.dispatcher;
|
|
897
|
-
}
|
|
898
396
|
|
|
899
|
-
/**
|
|
900
|
-
* @fileoverview added by tsickle
|
|
901
|
-
* Generated from: src/reducer.ts
|
|
902
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
903
|
-
*/
|
|
904
|
-
/** @type {?} */
|
|
905
397
|
const INIT_ACTION = { type: INIT };
|
|
906
|
-
|
|
907
|
-
const RECOMPUTE = (/** @type {?} */ ('@ngrx/store-devtools/recompute'));
|
|
908
|
-
/** @type {?} */
|
|
398
|
+
const RECOMPUTE = '@ngrx/store-devtools/recompute';
|
|
909
399
|
const RECOMPUTE_ACTION = { type: RECOMPUTE };
|
|
910
|
-
/**
|
|
911
|
-
* @record
|
|
912
|
-
*/
|
|
913
|
-
function ComputedState() { }
|
|
914
|
-
if (false) {
|
|
915
|
-
/** @type {?} */
|
|
916
|
-
ComputedState.prototype.state;
|
|
917
|
-
/** @type {?} */
|
|
918
|
-
ComputedState.prototype.error;
|
|
919
|
-
}
|
|
920
|
-
/**
|
|
921
|
-
* @record
|
|
922
|
-
*/
|
|
923
|
-
function LiftedAction() { }
|
|
924
|
-
if (false) {
|
|
925
|
-
/** @type {?} */
|
|
926
|
-
LiftedAction.prototype.type;
|
|
927
|
-
/** @type {?} */
|
|
928
|
-
LiftedAction.prototype.action;
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* @record
|
|
932
|
-
*/
|
|
933
|
-
function LiftedActions() { }
|
|
934
|
-
/**
|
|
935
|
-
* @record
|
|
936
|
-
*/
|
|
937
|
-
function LiftedState() { }
|
|
938
|
-
if (false) {
|
|
939
|
-
/** @type {?} */
|
|
940
|
-
LiftedState.prototype.monitorState;
|
|
941
|
-
/** @type {?} */
|
|
942
|
-
LiftedState.prototype.nextActionId;
|
|
943
|
-
/** @type {?} */
|
|
944
|
-
LiftedState.prototype.actionsById;
|
|
945
|
-
/** @type {?} */
|
|
946
|
-
LiftedState.prototype.stagedActionIds;
|
|
947
|
-
/** @type {?} */
|
|
948
|
-
LiftedState.prototype.skippedActionIds;
|
|
949
|
-
/** @type {?} */
|
|
950
|
-
LiftedState.prototype.committedState;
|
|
951
|
-
/** @type {?} */
|
|
952
|
-
LiftedState.prototype.currentStateIndex;
|
|
953
|
-
/** @type {?} */
|
|
954
|
-
LiftedState.prototype.computedStates;
|
|
955
|
-
/** @type {?} */
|
|
956
|
-
LiftedState.prototype.isLocked;
|
|
957
|
-
/** @type {?} */
|
|
958
|
-
LiftedState.prototype.isPaused;
|
|
959
|
-
}
|
|
960
400
|
/**
|
|
961
401
|
* Computes the next entry in the log by applying an action.
|
|
962
|
-
* @param {?} reducer
|
|
963
|
-
* @param {?} action
|
|
964
|
-
* @param {?} state
|
|
965
|
-
* @param {?} error
|
|
966
|
-
* @param {?} errorHandler
|
|
967
|
-
* @return {?}
|
|
968
402
|
*/
|
|
969
403
|
function computeNextEntry(reducer, action, state, error, errorHandler) {
|
|
970
404
|
if (error) {
|
|
@@ -973,9 +407,7 @@ function computeNextEntry(reducer, action, state, error, errorHandler) {
|
|
|
973
407
|
error: 'Interrupted by an error up the chain',
|
|
974
408
|
};
|
|
975
409
|
}
|
|
976
|
-
/** @type {?} */
|
|
977
410
|
let nextState = state;
|
|
978
|
-
/** @type {?} */
|
|
979
411
|
let nextError;
|
|
980
412
|
try {
|
|
981
413
|
nextState = reducer(state, action);
|
|
@@ -991,16 +423,6 @@ function computeNextEntry(reducer, action, state, error, errorHandler) {
|
|
|
991
423
|
}
|
|
992
424
|
/**
|
|
993
425
|
* Runs the reducer on invalidated actions to get a fresh computation log.
|
|
994
|
-
* @param {?} computedStates
|
|
995
|
-
* @param {?} minInvalidatedStateIndex
|
|
996
|
-
* @param {?} reducer
|
|
997
|
-
* @param {?} committedState
|
|
998
|
-
* @param {?} actionsById
|
|
999
|
-
* @param {?} stagedActionIds
|
|
1000
|
-
* @param {?} skippedActionIds
|
|
1001
|
-
* @param {?} errorHandler
|
|
1002
|
-
* @param {?} isPaused
|
|
1003
|
-
* @return {?}
|
|
1004
426
|
*/
|
|
1005
427
|
function recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused) {
|
|
1006
428
|
// Optimization: exit early and return the same reference
|
|
@@ -1009,26 +431,17 @@ function recomputeStates(computedStates, minInvalidatedStateIndex, reducer, comm
|
|
|
1009
431
|
computedStates.length === stagedActionIds.length) {
|
|
1010
432
|
return computedStates;
|
|
1011
433
|
}
|
|
1012
|
-
/** @type {?} */
|
|
1013
434
|
const nextComputedStates = computedStates.slice(0, minInvalidatedStateIndex);
|
|
1014
435
|
// If the recording is paused, recompute all states up until the pause state,
|
|
1015
436
|
// else recompute all states.
|
|
1016
|
-
/** @type {?} */
|
|
1017
437
|
const lastIncludedActionId = stagedActionIds.length - (isPaused ? 1 : 0);
|
|
1018
438
|
for (let i = minInvalidatedStateIndex; i < lastIncludedActionId; i++) {
|
|
1019
|
-
/** @type {?} */
|
|
1020
439
|
const actionId = stagedActionIds[i];
|
|
1021
|
-
/** @type {?} */
|
|
1022
440
|
const action = actionsById[actionId].action;
|
|
1023
|
-
/** @type {?} */
|
|
1024
441
|
const previousEntry = nextComputedStates[i - 1];
|
|
1025
|
-
/** @type {?} */
|
|
1026
442
|
const previousState = previousEntry ? previousEntry.state : committedState;
|
|
1027
|
-
/** @type {?} */
|
|
1028
443
|
const previousError = previousEntry ? previousEntry.error : undefined;
|
|
1029
|
-
/** @type {?} */
|
|
1030
444
|
const shouldSkip = skippedActionIds.indexOf(actionId) > -1;
|
|
1031
|
-
/** @type {?} */
|
|
1032
445
|
const entry = shouldSkip
|
|
1033
446
|
? previousEntry
|
|
1034
447
|
: computeNextEntry(reducer, action, previousState, previousError, errorHandler);
|
|
@@ -1041,11 +454,6 @@ function recomputeStates(computedStates, minInvalidatedStateIndex, reducer, comm
|
|
|
1041
454
|
}
|
|
1042
455
|
return nextComputedStates;
|
|
1043
456
|
}
|
|
1044
|
-
/**
|
|
1045
|
-
* @param {?=} initialCommittedState
|
|
1046
|
-
* @param {?=} monitorReducer
|
|
1047
|
-
* @return {?}
|
|
1048
|
-
*/
|
|
1049
457
|
function liftInitialState(initialCommittedState, monitorReducer) {
|
|
1050
458
|
return {
|
|
1051
459
|
monitorState: monitorReducer(undefined, {}),
|
|
@@ -1062,41 +470,20 @@ function liftInitialState(initialCommittedState, monitorReducer) {
|
|
|
1062
470
|
}
|
|
1063
471
|
/**
|
|
1064
472
|
* Creates a history state reducer from an app's reducer.
|
|
1065
|
-
* @param {?} initialCommittedState
|
|
1066
|
-
* @param {?} initialLiftedState
|
|
1067
|
-
* @param {?} errorHandler
|
|
1068
|
-
* @param {?=} monitorReducer
|
|
1069
|
-
* @param {?=} options
|
|
1070
|
-
* @return {?}
|
|
1071
473
|
*/
|
|
1072
474
|
function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler, monitorReducer, options = {}) {
|
|
1073
475
|
/**
|
|
1074
476
|
* Manages how the history actions modify the history state.
|
|
1075
477
|
*/
|
|
1076
|
-
return (
|
|
1077
|
-
* @param {?} reducer
|
|
1078
|
-
* @return {?}
|
|
1079
|
-
*/
|
|
1080
|
-
(reducer) => (/**
|
|
1081
|
-
* @param {?} liftedState
|
|
1082
|
-
* @param {?} liftedAction
|
|
1083
|
-
* @return {?}
|
|
1084
|
-
*/
|
|
1085
|
-
(liftedState, liftedAction) => {
|
|
478
|
+
return (reducer) => (liftedState, liftedAction) => {
|
|
1086
479
|
let { monitorState, actionsById, nextActionId, stagedActionIds, skippedActionIds, committedState, currentStateIndex, computedStates, isLocked, isPaused, } = liftedState || initialLiftedState;
|
|
1087
480
|
if (!liftedState) {
|
|
1088
481
|
// Prevent mutating initialLiftedState
|
|
1089
482
|
actionsById = Object.create(actionsById);
|
|
1090
483
|
}
|
|
1091
|
-
/**
|
|
1092
|
-
* @param {?} n
|
|
1093
|
-
* @return {?}
|
|
1094
|
-
*/
|
|
1095
484
|
function commitExcessActions(n) {
|
|
1096
485
|
// Auto-commits n-number of excess actions.
|
|
1097
|
-
/** @type {?} */
|
|
1098
486
|
let excess = n;
|
|
1099
|
-
/** @type {?} */
|
|
1100
487
|
let idsToDelete = stagedActionIds.slice(1, excess + 1);
|
|
1101
488
|
for (let i = 0; i < idsToDelete.length; i++) {
|
|
1102
489
|
if (computedStates[i + 1].error) {
|
|
@@ -1109,20 +496,13 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1109
496
|
delete actionsById[idsToDelete[i]];
|
|
1110
497
|
}
|
|
1111
498
|
}
|
|
1112
|
-
skippedActionIds = skippedActionIds.filter((
|
|
1113
|
-
* @param {?} id
|
|
1114
|
-
* @return {?}
|
|
1115
|
-
*/
|
|
1116
|
-
(id) => idsToDelete.indexOf(id) === -1));
|
|
499
|
+
skippedActionIds = skippedActionIds.filter((id) => idsToDelete.indexOf(id) === -1);
|
|
1117
500
|
stagedActionIds = [0, ...stagedActionIds.slice(excess + 1)];
|
|
1118
501
|
committedState = computedStates[excess].state;
|
|
1119
502
|
computedStates = computedStates.slice(excess);
|
|
1120
503
|
currentStateIndex =
|
|
1121
504
|
currentStateIndex > excess ? currentStateIndex - excess : 0;
|
|
1122
505
|
}
|
|
1123
|
-
/**
|
|
1124
|
-
* @return {?}
|
|
1125
|
-
*/
|
|
1126
506
|
function commitChanges() {
|
|
1127
507
|
// Consider the last committed state the new starting point.
|
|
1128
508
|
// Squash any staged actions into a single committed state.
|
|
@@ -1137,7 +517,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1137
517
|
// By default, aggressively recompute every state whatever happens.
|
|
1138
518
|
// This has O(n) performance, so we'll override this to a sensible
|
|
1139
519
|
// value whenever we feel like we don't have to recompute the states.
|
|
1140
|
-
/** @type {?} */
|
|
1141
520
|
let minInvalidatedStateIndex = 0;
|
|
1142
521
|
switch (liftedAction.type) {
|
|
1143
522
|
case LOCK_CHANGES: {
|
|
@@ -1198,17 +577,12 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1198
577
|
// Toggle whether an action with given ID is skipped.
|
|
1199
578
|
// Being skipped means it is a no-op during the computation.
|
|
1200
579
|
const { id: actionId } = liftedAction;
|
|
1201
|
-
/** @type {?} */
|
|
1202
580
|
const index = skippedActionIds.indexOf(actionId);
|
|
1203
581
|
if (index === -1) {
|
|
1204
582
|
skippedActionIds = [actionId, ...skippedActionIds];
|
|
1205
583
|
}
|
|
1206
584
|
else {
|
|
1207
|
-
skippedActionIds = skippedActionIds.filter((
|
|
1208
|
-
* @param {?} id
|
|
1209
|
-
* @return {?}
|
|
1210
|
-
*/
|
|
1211
|
-
(id) => id !== actionId));
|
|
585
|
+
skippedActionIds = skippedActionIds.filter((id) => id !== actionId);
|
|
1212
586
|
}
|
|
1213
587
|
// Optimization: we know history before this action hasn't changed
|
|
1214
588
|
minInvalidatedStateIndex = stagedActionIds.indexOf(actionId);
|
|
@@ -1218,7 +592,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1218
592
|
// Toggle whether an action with given ID is skipped.
|
|
1219
593
|
// Being skipped means it is a no-op during the computation.
|
|
1220
594
|
const { start, end, active } = liftedAction;
|
|
1221
|
-
/** @type {?} */
|
|
1222
595
|
const actionIds = [];
|
|
1223
596
|
for (let i = start; i < end; i++)
|
|
1224
597
|
actionIds.push(i);
|
|
@@ -1243,7 +616,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1243
616
|
case JUMP_TO_ACTION: {
|
|
1244
617
|
// Jumps to a corresponding state to a specific action.
|
|
1245
618
|
// Useful when filtering actions.
|
|
1246
|
-
/** @type {?} */
|
|
1247
619
|
const index = stagedActionIds.indexOf(liftedAction.actionId);
|
|
1248
620
|
if (index !== -1)
|
|
1249
621
|
currentStateIndex = index;
|
|
@@ -1269,7 +641,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1269
641
|
// (corresponds to the pause action) and keep everything else as is.
|
|
1270
642
|
// This way, the app gets the new current state while the devtools
|
|
1271
643
|
// do not record another action.
|
|
1272
|
-
/** @type {?} */
|
|
1273
644
|
const lastState = computedStates[computedStates.length - 1];
|
|
1274
645
|
computedStates = [
|
|
1275
646
|
...computedStates.slice(0, -1),
|
|
@@ -1285,7 +656,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1285
656
|
if (currentStateIndex === stagedActionIds.length - 1) {
|
|
1286
657
|
currentStateIndex++;
|
|
1287
658
|
}
|
|
1288
|
-
/** @type {?} */
|
|
1289
659
|
const actionId = nextActionId++;
|
|
1290
660
|
// Mutation! This is the hottest path, and we optimize on purpose.
|
|
1291
661
|
// It is safe because we set a new key in a cache dictionary.
|
|
@@ -1324,12 +694,7 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1324
694
|
break;
|
|
1325
695
|
}
|
|
1326
696
|
case UPDATE: {
|
|
1327
|
-
|
|
1328
|
-
const stateHasErrors = computedStates.filter((/**
|
|
1329
|
-
* @param {?} state
|
|
1330
|
-
* @return {?}
|
|
1331
|
-
*/
|
|
1332
|
-
(state) => state.error)).length > 0;
|
|
697
|
+
const stateHasErrors = computedStates.filter((state) => state.error).length > 0;
|
|
1333
698
|
if (stateHasErrors) {
|
|
1334
699
|
// Recompute all states
|
|
1335
700
|
minInvalidatedStateIndex = 0;
|
|
@@ -1349,7 +714,6 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1349
714
|
currentStateIndex++;
|
|
1350
715
|
}
|
|
1351
716
|
// Add a new action to only recompute state
|
|
1352
|
-
/** @type {?} */
|
|
1353
717
|
const actionId = nextActionId++;
|
|
1354
718
|
actionsById[actionId] = new PerformAction(liftedAction, +Date.now());
|
|
1355
719
|
stagedActionIds = [...stagedActionIds, actionId];
|
|
@@ -1357,11 +721,7 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1357
721
|
computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);
|
|
1358
722
|
}
|
|
1359
723
|
// Recompute state history with latest reducer and update action
|
|
1360
|
-
computedStates = computedStates.map((
|
|
1361
|
-
* @param {?} cmp
|
|
1362
|
-
* @return {?}
|
|
1363
|
-
*/
|
|
1364
|
-
(cmp) => (Object.assign(Object.assign({}, cmp), { state: reducer(cmp.state, RECOMPUTE_ACTION) }))));
|
|
724
|
+
computedStates = computedStates.map((cmp) => (Object.assign(Object.assign({}, cmp), { state: reducer(cmp.state, RECOMPUTE_ACTION) })));
|
|
1365
725
|
currentStateIndex = stagedActionIds.length - 1;
|
|
1366
726
|
if (options.maxAge && stagedActionIds.length > options.maxAge) {
|
|
1367
727
|
commitExcessActions(stagedActionIds.length - options.maxAge);
|
|
@@ -1392,45 +752,18 @@ function liftReducerWith(initialCommittedState, initialLiftedState, errorHandler
|
|
|
1392
752
|
isLocked,
|
|
1393
753
|
isPaused,
|
|
1394
754
|
};
|
|
1395
|
-
}
|
|
755
|
+
};
|
|
1396
756
|
}
|
|
1397
757
|
|
|
1398
|
-
/**
|
|
1399
|
-
* @fileoverview added by tsickle
|
|
1400
|
-
* Generated from: src/devtools.ts
|
|
1401
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1402
|
-
*/
|
|
1403
758
|
class StoreDevtools {
|
|
1404
|
-
/**
|
|
1405
|
-
* @param {?} dispatcher
|
|
1406
|
-
* @param {?} actions$
|
|
1407
|
-
* @param {?} reducers$
|
|
1408
|
-
* @param {?} extension
|
|
1409
|
-
* @param {?} scannedActions
|
|
1410
|
-
* @param {?} errorHandler
|
|
1411
|
-
* @param {?} initialState
|
|
1412
|
-
* @param {?} config
|
|
1413
|
-
*/
|
|
1414
759
|
constructor(dispatcher, actions$, reducers$, extension, scannedActions, errorHandler, initialState, config) {
|
|
1415
|
-
/** @type {?} */
|
|
1416
760
|
const liftedInitialState = liftInitialState(initialState, config.monitor);
|
|
1417
|
-
/** @type {?} */
|
|
1418
761
|
const liftReducer = liftReducerWith(initialState, liftedInitialState, errorHandler, config.monitor, config);
|
|
1419
|
-
/** @type {?} */
|
|
1420
762
|
const liftedAction$ = merge(merge(actions$.asObservable().pipe(skip(1)), extension.actions$).pipe(map(liftAction)), dispatcher, extension.liftedActions$).pipe(observeOn(queueScheduler));
|
|
1421
|
-
/** @type {?} */
|
|
1422
763
|
const liftedReducer$ = reducers$.pipe(map(liftReducer));
|
|
1423
|
-
/** @type {?} */
|
|
1424
764
|
const liftedStateSubject = new ReplaySubject(1);
|
|
1425
|
-
/** @type {?} */
|
|
1426
765
|
const liftedStateSubscription = liftedAction$
|
|
1427
|
-
.pipe(withLatestFrom(liftedReducer$), scan((
|
|
1428
|
-
* @param {?} __0
|
|
1429
|
-
* @param {?} __1
|
|
1430
|
-
* @return {?}
|
|
1431
|
-
*/
|
|
1432
|
-
({ state: liftedState }, [action, reducer]) => {
|
|
1433
|
-
/** @type {?} */
|
|
766
|
+
.pipe(withLatestFrom(liftedReducer$), scan(({ state: liftedState }, [action, reducer]) => {
|
|
1434
767
|
let reducedLiftedState = reducer(liftedState, action);
|
|
1435
768
|
// On full state update
|
|
1436
769
|
// If we have actions filters, we must filter completely our lifted state to be sync with the extension
|
|
@@ -1440,29 +773,18 @@ class StoreDevtools {
|
|
|
1440
773
|
// Extension should be sent the sanitized lifted state
|
|
1441
774
|
extension.notify(action, reducedLiftedState);
|
|
1442
775
|
return { state: reducedLiftedState, action };
|
|
1443
|
-
}
|
|
1444
|
-
.subscribe((
|
|
1445
|
-
* @param {?} __0
|
|
1446
|
-
* @return {?}
|
|
1447
|
-
*/
|
|
1448
|
-
({ state, action }) => {
|
|
776
|
+
}, { state: liftedInitialState, action: null }))
|
|
777
|
+
.subscribe(({ state, action }) => {
|
|
1449
778
|
liftedStateSubject.next(state);
|
|
1450
779
|
if (action.type === PERFORM_ACTION) {
|
|
1451
|
-
|
|
1452
|
-
const unliftedAction = ((/** @type {?} */ (action))).action;
|
|
780
|
+
const unliftedAction = action.action;
|
|
1453
781
|
scannedActions.next(unliftedAction);
|
|
1454
782
|
}
|
|
1455
|
-
})
|
|
1456
|
-
|
|
1457
|
-
const extensionStartSubscription = extension.start$.subscribe((/**
|
|
1458
|
-
* @return {?}
|
|
1459
|
-
*/
|
|
1460
|
-
() => {
|
|
783
|
+
});
|
|
784
|
+
const extensionStartSubscription = extension.start$.subscribe(() => {
|
|
1461
785
|
this.refresh();
|
|
1462
|
-
})
|
|
1463
|
-
|
|
1464
|
-
const liftedState$ = (/** @type {?} */ (liftedStateSubject.asObservable()));
|
|
1465
|
-
/** @type {?} */
|
|
786
|
+
});
|
|
787
|
+
const liftedState$ = liftedStateSubject.asObservable();
|
|
1466
788
|
const state$ = liftedState$.pipe(map(unliftState));
|
|
1467
789
|
this.extensionStartSubscription = extensionStartSubscription;
|
|
1468
790
|
this.stateSubscription = liftedStateSubscription;
|
|
@@ -1470,105 +792,47 @@ class StoreDevtools {
|
|
|
1470
792
|
this.liftedState = liftedState$;
|
|
1471
793
|
this.state = state$;
|
|
1472
794
|
}
|
|
1473
|
-
/**
|
|
1474
|
-
* @param {?} action
|
|
1475
|
-
* @return {?}
|
|
1476
|
-
*/
|
|
1477
795
|
dispatch(action) {
|
|
1478
796
|
this.dispatcher.next(action);
|
|
1479
797
|
}
|
|
1480
|
-
/**
|
|
1481
|
-
* @param {?} action
|
|
1482
|
-
* @return {?}
|
|
1483
|
-
*/
|
|
1484
798
|
next(action) {
|
|
1485
799
|
this.dispatcher.next(action);
|
|
1486
800
|
}
|
|
1487
|
-
/**
|
|
1488
|
-
* @param {?} error
|
|
1489
|
-
* @return {?}
|
|
1490
|
-
*/
|
|
1491
801
|
error(error) { }
|
|
1492
|
-
/**
|
|
1493
|
-
* @return {?}
|
|
1494
|
-
*/
|
|
1495
802
|
complete() { }
|
|
1496
|
-
/**
|
|
1497
|
-
* @param {?} action
|
|
1498
|
-
* @return {?}
|
|
1499
|
-
*/
|
|
1500
803
|
performAction(action) {
|
|
1501
804
|
this.dispatch(new PerformAction(action, +Date.now()));
|
|
1502
805
|
}
|
|
1503
|
-
/**
|
|
1504
|
-
* @return {?}
|
|
1505
|
-
*/
|
|
1506
806
|
refresh() {
|
|
1507
807
|
this.dispatch(new Refresh());
|
|
1508
808
|
}
|
|
1509
|
-
/**
|
|
1510
|
-
* @return {?}
|
|
1511
|
-
*/
|
|
1512
809
|
reset() {
|
|
1513
810
|
this.dispatch(new Reset(+Date.now()));
|
|
1514
811
|
}
|
|
1515
|
-
/**
|
|
1516
|
-
* @return {?}
|
|
1517
|
-
*/
|
|
1518
812
|
rollback() {
|
|
1519
813
|
this.dispatch(new Rollback(+Date.now()));
|
|
1520
814
|
}
|
|
1521
|
-
/**
|
|
1522
|
-
* @return {?}
|
|
1523
|
-
*/
|
|
1524
815
|
commit() {
|
|
1525
816
|
this.dispatch(new Commit(+Date.now()));
|
|
1526
817
|
}
|
|
1527
|
-
/**
|
|
1528
|
-
* @return {?}
|
|
1529
|
-
*/
|
|
1530
818
|
sweep() {
|
|
1531
819
|
this.dispatch(new Sweep());
|
|
1532
820
|
}
|
|
1533
|
-
/**
|
|
1534
|
-
* @param {?} id
|
|
1535
|
-
* @return {?}
|
|
1536
|
-
*/
|
|
1537
821
|
toggleAction(id) {
|
|
1538
822
|
this.dispatch(new ToggleAction(id));
|
|
1539
823
|
}
|
|
1540
|
-
/**
|
|
1541
|
-
* @param {?} actionId
|
|
1542
|
-
* @return {?}
|
|
1543
|
-
*/
|
|
1544
824
|
jumpToAction(actionId) {
|
|
1545
825
|
this.dispatch(new JumpToAction(actionId));
|
|
1546
826
|
}
|
|
1547
|
-
/**
|
|
1548
|
-
* @param {?} index
|
|
1549
|
-
* @return {?}
|
|
1550
|
-
*/
|
|
1551
827
|
jumpToState(index) {
|
|
1552
828
|
this.dispatch(new JumpToState(index));
|
|
1553
829
|
}
|
|
1554
|
-
/**
|
|
1555
|
-
* @param {?} nextLiftedState
|
|
1556
|
-
* @return {?}
|
|
1557
|
-
*/
|
|
1558
830
|
importState(nextLiftedState) {
|
|
1559
831
|
this.dispatch(new ImportState(nextLiftedState));
|
|
1560
832
|
}
|
|
1561
|
-
/**
|
|
1562
|
-
* @param {?} status
|
|
1563
|
-
* @return {?}
|
|
1564
|
-
*/
|
|
1565
833
|
lockChanges(status) {
|
|
1566
834
|
this.dispatch(new LockChanges(status));
|
|
1567
835
|
}
|
|
1568
|
-
/**
|
|
1569
|
-
* @param {?} status
|
|
1570
|
-
* @return {?}
|
|
1571
|
-
*/
|
|
1572
836
|
pauseRecording(status) {
|
|
1573
837
|
this.dispatch(new PauseRecording(status));
|
|
1574
838
|
}
|
|
@@ -1587,66 +851,25 @@ StoreDevtools.ctorParameters = () => [
|
|
|
1587
851
|
{ type: undefined, decorators: [{ type: Inject, args: [INITIAL_STATE,] }] },
|
|
1588
852
|
{ type: StoreDevtoolsConfig, decorators: [{ type: Inject, args: [STORE_DEVTOOLS_CONFIG,] }] }
|
|
1589
853
|
];
|
|
1590
|
-
if (false) {
|
|
1591
|
-
/**
|
|
1592
|
-
* @type {?}
|
|
1593
|
-
* @private
|
|
1594
|
-
*/
|
|
1595
|
-
StoreDevtools.prototype.stateSubscription;
|
|
1596
|
-
/**
|
|
1597
|
-
* @type {?}
|
|
1598
|
-
* @private
|
|
1599
|
-
*/
|
|
1600
|
-
StoreDevtools.prototype.extensionStartSubscription;
|
|
1601
|
-
/** @type {?} */
|
|
1602
|
-
StoreDevtools.prototype.dispatcher;
|
|
1603
|
-
/** @type {?} */
|
|
1604
|
-
StoreDevtools.prototype.liftedState;
|
|
1605
|
-
/** @type {?} */
|
|
1606
|
-
StoreDevtools.prototype.state;
|
|
1607
|
-
}
|
|
1608
854
|
|
|
1609
|
-
/**
|
|
1610
|
-
* @fileoverview added by tsickle
|
|
1611
|
-
* Generated from: src/instrument.ts
|
|
1612
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1613
|
-
*/
|
|
1614
|
-
/** @type {?} */
|
|
1615
855
|
const IS_EXTENSION_OR_MONITOR_PRESENT = new InjectionToken('@ngrx/store-devtools Is Devtools Extension or Monitor Present');
|
|
1616
|
-
/**
|
|
1617
|
-
* @param {?} extension
|
|
1618
|
-
* @param {?} config
|
|
1619
|
-
* @return {?}
|
|
1620
|
-
*/
|
|
1621
856
|
function createIsExtensionOrMonitorPresent(extension, config) {
|
|
1622
857
|
return Boolean(extension) || config.monitor !== noMonitor;
|
|
1623
858
|
}
|
|
1624
|
-
/**
|
|
1625
|
-
* @return {?}
|
|
1626
|
-
*/
|
|
1627
859
|
function createReduxDevtoolsExtension() {
|
|
1628
|
-
/** @type {?} */
|
|
1629
860
|
const extensionKey = '__REDUX_DEVTOOLS_EXTENSION__';
|
|
1630
861
|
if (typeof window === 'object' &&
|
|
1631
|
-
typeof
|
|
1632
|
-
return
|
|
862
|
+
typeof window[extensionKey] !== 'undefined') {
|
|
863
|
+
return window[extensionKey];
|
|
1633
864
|
}
|
|
1634
865
|
else {
|
|
1635
866
|
return null;
|
|
1636
867
|
}
|
|
1637
868
|
}
|
|
1638
|
-
/**
|
|
1639
|
-
* @param {?} devtools
|
|
1640
|
-
* @return {?}
|
|
1641
|
-
*/
|
|
1642
869
|
function createStateObservable(devtools) {
|
|
1643
870
|
return devtools.state;
|
|
1644
871
|
}
|
|
1645
872
|
class StoreDevtoolsModule {
|
|
1646
|
-
/**
|
|
1647
|
-
* @param {?=} options
|
|
1648
|
-
* @return {?}
|
|
1649
|
-
*/
|
|
1650
873
|
static instrument(options = {}) {
|
|
1651
874
|
return {
|
|
1652
875
|
ngModule: StoreDevtoolsModule,
|
|
@@ -1690,27 +913,13 @@ StoreDevtoolsModule.decorators = [
|
|
|
1690
913
|
];
|
|
1691
914
|
|
|
1692
915
|
/**
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1696
|
-
*/
|
|
1697
|
-
|
|
1698
|
-
/**
|
|
1699
|
-
* @fileoverview added by tsickle
|
|
1700
|
-
* Generated from: public_api.ts
|
|
1701
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1702
|
-
*/
|
|
1703
|
-
|
|
1704
|
-
/**
|
|
1705
|
-
* @fileoverview added by tsickle
|
|
1706
|
-
* Generated from: index.ts
|
|
1707
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
916
|
+
* DO NOT EDIT
|
|
917
|
+
*
|
|
918
|
+
* This file is automatically generated at build
|
|
1708
919
|
*/
|
|
1709
920
|
|
|
1710
921
|
/**
|
|
1711
|
-
*
|
|
1712
|
-
* Generated from: ngrx-store-devtools.ts
|
|
1713
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
922
|
+
* Generated bundle index. Do not edit.
|
|
1714
923
|
*/
|
|
1715
924
|
|
|
1716
925
|
export { INITIAL_OPTIONS, RECOMPUTE, StoreDevtools, StoreDevtoolsConfig, StoreDevtoolsModule, IS_EXTENSION_OR_MONITOR_PRESENT as ɵa, createIsExtensionOrMonitorPresent as ɵb, createReduxDevtoolsExtension as ɵc, createStateObservable as ɵd, STORE_DEVTOOLS_CONFIG as ɵe, noMonitor as ɵf, createConfig as ɵg, REDUX_DEVTOOLS_EXTENSION as ɵh, DevtoolsExtension as ɵi, DevtoolsDispatcher as ɵj };
|