@ngxs/devtools-plugin 3.7.3-dev.master-5175b98 → 3.7.3
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/README.md +3 -3
- package/bundles/ngxs-devtools-plugin.umd.js +314 -378
- package/bundles/ngxs-devtools-plugin.umd.js.map +1 -1
- package/bundles/ngxs-devtools-plugin.umd.min.js +2 -2
- package/bundles/ngxs-devtools-plugin.umd.min.js.map +1 -1
- package/esm2015/index.js +9 -9
- package/esm2015/ngxs-devtools-plugin.js +9 -9
- package/esm2015/src/devtools.module.js +48 -48
- package/esm2015/src/devtools.plugin.js +162 -220
- package/esm2015/src/public_api.js +8 -8
- package/esm2015/src/symbols.js +78 -78
- package/esm5/index.js +9 -9
- package/esm5/ngxs-devtools-plugin.js +9 -9
- package/esm5/src/devtools.module.js +57 -57
- package/esm5/src/devtools.plugin.js +198 -262
- package/esm5/src/public_api.js +8 -8
- package/esm5/src/symbols.js +78 -78
- package/fesm2015/ngxs-devtools-plugin.js +283 -341
- package/fesm2015/ngxs-devtools-plugin.js.map +1 -1
- package/fesm5/ngxs-devtools-plugin.js +324 -388
- package/fesm5/ngxs-devtools-plugin.js.map +1 -1
- package/index.d.ts +4 -4
- package/ngxs-devtools-plugin.d.ts +5 -5
- package/ngxs-devtools-plugin.metadata.json +1 -1
- package/package.json +3 -3
- package/src/devtools.module.d.ts +13 -13
- package/src/devtools.plugin.d.ts +27 -31
- package/src/public_api.d.ts +3 -3
- package/src/symbols.d.ts +40 -39
|
@@ -1,405 +1,341 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, Injectable, Inject, Injector, NgModule } from '@angular/core';
|
|
3
3
|
import { Store, getActionTypeFromInstance, NGXS_PLUGINS } from '@ngxs/store';
|
|
4
4
|
import { catchError, tap } from 'rxjs/operators';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @fileoverview added by tsickle
|
|
8
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Interface for the redux-devtools-extension API.
|
|
12
|
-
* @record
|
|
13
|
-
*/
|
|
14
|
-
function NgxsDevtoolsExtension() { }
|
|
15
|
-
if (false) {
|
|
16
|
-
/**
|
|
17
|
-
* @param {?} state
|
|
18
|
-
* @return {?}
|
|
19
|
-
*/
|
|
20
|
-
NgxsDevtoolsExtension.prototype.init = function (state) { };
|
|
21
|
-
/**
|
|
22
|
-
* @param {?} action
|
|
23
|
-
* @param {?=} state
|
|
24
|
-
* @return {?}
|
|
25
|
-
*/
|
|
26
|
-
NgxsDevtoolsExtension.prototype.send = function (action, state) { };
|
|
27
|
-
/**
|
|
28
|
-
* @param {?} fn
|
|
29
|
-
* @return {?}
|
|
30
|
-
*/
|
|
31
|
-
NgxsDevtoolsExtension.prototype.subscribe = function (fn) { };
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @record
|
|
35
|
-
*/
|
|
36
|
-
function NgxsDevtoolsAction() { }
|
|
37
|
-
if (false) {
|
|
38
|
-
/** @type {?} */
|
|
39
|
-
NgxsDevtoolsAction.prototype.type;
|
|
40
|
-
/** @type {?} */
|
|
41
|
-
NgxsDevtoolsAction.prototype.payload;
|
|
42
|
-
/** @type {?} */
|
|
43
|
-
NgxsDevtoolsAction.prototype.state;
|
|
44
|
-
/** @type {?} */
|
|
45
|
-
NgxsDevtoolsAction.prototype.id;
|
|
46
|
-
/** @type {?} */
|
|
47
|
-
NgxsDevtoolsAction.prototype.source;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @record
|
|
51
|
-
*/
|
|
52
|
-
function NgxsDevtoolsOptions() { }
|
|
53
|
-
if (false) {
|
|
54
|
-
/**
|
|
55
|
-
* The name of the extension
|
|
56
|
-
* @type {?|undefined}
|
|
57
|
-
*/
|
|
58
|
-
NgxsDevtoolsOptions.prototype.name;
|
|
59
|
-
/**
|
|
60
|
-
* Whether the dev tools is enabled or note. Useful for setting during production.
|
|
61
|
-
* @type {?|undefined}
|
|
62
|
-
*/
|
|
63
|
-
NgxsDevtoolsOptions.prototype.disabled;
|
|
64
|
-
/**
|
|
65
|
-
* Max number of entiries to keep.
|
|
66
|
-
* @type {?|undefined}
|
|
67
|
-
*/
|
|
68
|
-
NgxsDevtoolsOptions.prototype.maxAge;
|
|
69
|
-
/**
|
|
70
|
-
* Reformat actions before sending to dev tools
|
|
71
|
-
* @type {?|undefined}
|
|
72
|
-
*/
|
|
73
|
-
NgxsDevtoolsOptions.prototype.actionSanitizer;
|
|
74
|
-
/**
|
|
75
|
-
* Reformat state before sending to devtools
|
|
76
|
-
* @type {?|undefined}
|
|
77
|
-
*/
|
|
78
|
-
NgxsDevtoolsOptions.prototype.stateSanitizer;
|
|
79
|
-
}
|
|
80
|
-
/** @type {?} */
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview added by tsickle
|
|
8
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Interface for the redux-devtools-extension API.
|
|
12
|
+
* @record
|
|
13
|
+
*/
|
|
14
|
+
function NgxsDevtoolsExtension() { }
|
|
15
|
+
if (false) {
|
|
16
|
+
/**
|
|
17
|
+
* @param {?} state
|
|
18
|
+
* @return {?}
|
|
19
|
+
*/
|
|
20
|
+
NgxsDevtoolsExtension.prototype.init = function (state) { };
|
|
21
|
+
/**
|
|
22
|
+
* @param {?} action
|
|
23
|
+
* @param {?=} state
|
|
24
|
+
* @return {?}
|
|
25
|
+
*/
|
|
26
|
+
NgxsDevtoolsExtension.prototype.send = function (action, state) { };
|
|
27
|
+
/**
|
|
28
|
+
* @param {?} fn
|
|
29
|
+
* @return {?}
|
|
30
|
+
*/
|
|
31
|
+
NgxsDevtoolsExtension.prototype.subscribe = function (fn) { };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @record
|
|
35
|
+
*/
|
|
36
|
+
function NgxsDevtoolsAction() { }
|
|
37
|
+
if (false) {
|
|
38
|
+
/** @type {?} */
|
|
39
|
+
NgxsDevtoolsAction.prototype.type;
|
|
40
|
+
/** @type {?} */
|
|
41
|
+
NgxsDevtoolsAction.prototype.payload;
|
|
42
|
+
/** @type {?} */
|
|
43
|
+
NgxsDevtoolsAction.prototype.state;
|
|
44
|
+
/** @type {?} */
|
|
45
|
+
NgxsDevtoolsAction.prototype.id;
|
|
46
|
+
/** @type {?} */
|
|
47
|
+
NgxsDevtoolsAction.prototype.source;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @record
|
|
51
|
+
*/
|
|
52
|
+
function NgxsDevtoolsOptions() { }
|
|
53
|
+
if (false) {
|
|
54
|
+
/**
|
|
55
|
+
* The name of the extension
|
|
56
|
+
* @type {?|undefined}
|
|
57
|
+
*/
|
|
58
|
+
NgxsDevtoolsOptions.prototype.name;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the dev tools is enabled or note. Useful for setting during production.
|
|
61
|
+
* @type {?|undefined}
|
|
62
|
+
*/
|
|
63
|
+
NgxsDevtoolsOptions.prototype.disabled;
|
|
64
|
+
/**
|
|
65
|
+
* Max number of entiries to keep.
|
|
66
|
+
* @type {?|undefined}
|
|
67
|
+
*/
|
|
68
|
+
NgxsDevtoolsOptions.prototype.maxAge;
|
|
69
|
+
/**
|
|
70
|
+
* Reformat actions before sending to dev tools
|
|
71
|
+
* @type {?|undefined}
|
|
72
|
+
*/
|
|
73
|
+
NgxsDevtoolsOptions.prototype.actionSanitizer;
|
|
74
|
+
/**
|
|
75
|
+
* Reformat state before sending to devtools
|
|
76
|
+
* @type {?|undefined}
|
|
77
|
+
*/
|
|
78
|
+
NgxsDevtoolsOptions.prototype.stateSanitizer;
|
|
79
|
+
}
|
|
80
|
+
/** @type {?} */
|
|
81
81
|
var NGXS_DEVTOOLS_OPTIONS = new InjectionToken('NGXS_DEVTOOLS_OPTIONS');
|
|
82
82
|
|
|
83
|
-
/**
|
|
84
|
-
* @fileoverview added by tsickle
|
|
85
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*
|
|
194
|
-
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* @
|
|
260
|
-
* @
|
|
261
|
-
*/
|
|
262
|
-
NgxsReduxDevtoolsPlugin.prototype.
|
|
263
|
-
|
|
264
|
-
* @
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
// We handle only 2 events; thus, we don't want to run many change detections
|
|
274
|
-
// because the extension sends events that we don't have to handle.
|
|
275
|
-
this.devtoolsExtension = this._ngZone.runOutsideAngular((/**
|
|
276
|
-
* @return {?}
|
|
277
|
-
*/
|
|
278
|
-
function () { return (/** @type {?} */ (_this.globalDevtools.connect(_this._options))); }));
|
|
279
|
-
this.unsubscribe = this.devtoolsExtension.subscribe((/**
|
|
280
|
-
* @param {?} action
|
|
281
|
-
* @return {?}
|
|
282
|
-
*/
|
|
283
|
-
function (action) {
|
|
284
|
-
if (action.type === "DISPATCH" /* Dispatch */ ||
|
|
285
|
-
action.type === "ACTION" /* Action */) {
|
|
286
|
-
_this._ngZone.run((/**
|
|
287
|
-
* @return {?}
|
|
288
|
-
*/
|
|
289
|
-
function () {
|
|
290
|
-
_this.dispatched(action);
|
|
291
|
-
}));
|
|
292
|
-
}
|
|
293
|
-
}));
|
|
294
|
-
};
|
|
295
|
-
NgxsReduxDevtoolsPlugin.decorators = [
|
|
296
|
-
{ type: Injectable }
|
|
297
|
-
];
|
|
298
|
-
/** @nocollapse */
|
|
299
|
-
NgxsReduxDevtoolsPlugin.ctorParameters = function () { return [
|
|
300
|
-
{ type: undefined, decorators: [{ type: Inject, args: [NGXS_DEVTOOLS_OPTIONS,] }] },
|
|
301
|
-
{ type: Injector },
|
|
302
|
-
{ type: NgZone }
|
|
303
|
-
]; };
|
|
304
|
-
return NgxsReduxDevtoolsPlugin;
|
|
305
|
-
}());
|
|
306
|
-
if (false) {
|
|
307
|
-
/**
|
|
308
|
-
* @type {?}
|
|
309
|
-
* @private
|
|
310
|
-
*/
|
|
311
|
-
NgxsReduxDevtoolsPlugin.prototype.devtoolsExtension;
|
|
312
|
-
/**
|
|
313
|
-
* @type {?}
|
|
314
|
-
* @private
|
|
315
|
-
*/
|
|
316
|
-
NgxsReduxDevtoolsPlugin.prototype.globalDevtools;
|
|
317
|
-
/**
|
|
318
|
-
* @type {?}
|
|
319
|
-
* @private
|
|
320
|
-
*/
|
|
321
|
-
NgxsReduxDevtoolsPlugin.prototype.unsubscribe;
|
|
322
|
-
/**
|
|
323
|
-
* @type {?}
|
|
324
|
-
* @private
|
|
325
|
-
*/
|
|
326
|
-
NgxsReduxDevtoolsPlugin.prototype._options;
|
|
327
|
-
/**
|
|
328
|
-
* @type {?}
|
|
329
|
-
* @private
|
|
330
|
-
*/
|
|
331
|
-
NgxsReduxDevtoolsPlugin.prototype._injector;
|
|
332
|
-
/**
|
|
333
|
-
* @type {?}
|
|
334
|
-
* @private
|
|
335
|
-
*/
|
|
336
|
-
NgxsReduxDevtoolsPlugin.prototype._ngZone;
|
|
83
|
+
/**
|
|
84
|
+
* @fileoverview added by tsickle
|
|
85
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Adds support for the Redux Devtools extension:
|
|
89
|
+
* http://extension.remotedev.io/
|
|
90
|
+
*/
|
|
91
|
+
var NgxsReduxDevtoolsPlugin = /** @class */ (function () {
|
|
92
|
+
function NgxsReduxDevtoolsPlugin(_options, _injector) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
this._options = _options;
|
|
95
|
+
this._injector = _injector;
|
|
96
|
+
this.devtoolsExtension = null;
|
|
97
|
+
this.windowObj = typeof window !== 'undefined' ? window : {};
|
|
98
|
+
/** @type {?} */
|
|
99
|
+
var globalDevtools = this.windowObj['__REDUX_DEVTOOLS_EXTENSION__'] || this.windowObj['devToolsExtension'];
|
|
100
|
+
if (globalDevtools) {
|
|
101
|
+
this.devtoolsExtension = (/** @type {?} */ (globalDevtools.connect(_options)));
|
|
102
|
+
this.devtoolsExtension.subscribe((/**
|
|
103
|
+
* @param {?} a
|
|
104
|
+
* @return {?}
|
|
105
|
+
*/
|
|
106
|
+
function (a) { return _this.dispatched(a); }));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
Object.defineProperty(NgxsReduxDevtoolsPlugin.prototype, "store", {
|
|
110
|
+
/**
|
|
111
|
+
* Lazy get the store for circular dependency issues
|
|
112
|
+
*/
|
|
113
|
+
get: /**
|
|
114
|
+
* Lazy get the store for circular dependency issues
|
|
115
|
+
* @private
|
|
116
|
+
* @return {?}
|
|
117
|
+
*/
|
|
118
|
+
function () {
|
|
119
|
+
return this._injector.get(Store);
|
|
120
|
+
},
|
|
121
|
+
enumerable: true,
|
|
122
|
+
configurable: true
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Middleware handle function
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Middleware handle function
|
|
129
|
+
* @param {?} state
|
|
130
|
+
* @param {?} action
|
|
131
|
+
* @param {?} next
|
|
132
|
+
* @return {?}
|
|
133
|
+
*/
|
|
134
|
+
NgxsReduxDevtoolsPlugin.prototype.handle = /**
|
|
135
|
+
* Middleware handle function
|
|
136
|
+
* @param {?} state
|
|
137
|
+
* @param {?} action
|
|
138
|
+
* @param {?} next
|
|
139
|
+
* @return {?}
|
|
140
|
+
*/
|
|
141
|
+
function (state, action, next) {
|
|
142
|
+
var _this = this;
|
|
143
|
+
/** @type {?} */
|
|
144
|
+
var isDisabled = this._options && this._options.disabled;
|
|
145
|
+
if (!this.devtoolsExtension || isDisabled) {
|
|
146
|
+
return next(state, action);
|
|
147
|
+
}
|
|
148
|
+
return next(state, action).pipe(catchError((/**
|
|
149
|
+
* @param {?} error
|
|
150
|
+
* @return {?}
|
|
151
|
+
*/
|
|
152
|
+
function (error) {
|
|
153
|
+
/** @type {?} */
|
|
154
|
+
var newState = _this.store.snapshot();
|
|
155
|
+
_this.sendToDevTools(state, action, newState);
|
|
156
|
+
throw error;
|
|
157
|
+
})), tap((/**
|
|
158
|
+
* @param {?} newState
|
|
159
|
+
* @return {?}
|
|
160
|
+
*/
|
|
161
|
+
function (newState) {
|
|
162
|
+
_this.sendToDevTools(state, action, newState);
|
|
163
|
+
})));
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @private
|
|
167
|
+
* @param {?} state
|
|
168
|
+
* @param {?} action
|
|
169
|
+
* @param {?} newState
|
|
170
|
+
* @return {?}
|
|
171
|
+
*/
|
|
172
|
+
NgxsReduxDevtoolsPlugin.prototype.sendToDevTools = /**
|
|
173
|
+
* @private
|
|
174
|
+
* @param {?} state
|
|
175
|
+
* @param {?} action
|
|
176
|
+
* @param {?} newState
|
|
177
|
+
* @return {?}
|
|
178
|
+
*/
|
|
179
|
+
function (state, action, newState) {
|
|
180
|
+
/** @type {?} */
|
|
181
|
+
var type = getActionTypeFromInstance(action);
|
|
182
|
+
// if init action, send initial state to dev tools
|
|
183
|
+
/** @type {?} */
|
|
184
|
+
var isInitAction = type === '@@INIT';
|
|
185
|
+
if (isInitAction) {
|
|
186
|
+
(/** @type {?} */ (this.devtoolsExtension)).init(state);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
(/** @type {?} */ (this.devtoolsExtension)).send(__assign({}, action, { action: null, type: type }), newState);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Handle the action from the dev tools subscription
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* Handle the action from the dev tools subscription
|
|
197
|
+
* @param {?} action
|
|
198
|
+
* @return {?}
|
|
199
|
+
*/
|
|
200
|
+
NgxsReduxDevtoolsPlugin.prototype.dispatched = /**
|
|
201
|
+
* Handle the action from the dev tools subscription
|
|
202
|
+
* @param {?} action
|
|
203
|
+
* @return {?}
|
|
204
|
+
*/
|
|
205
|
+
function (action) {
|
|
206
|
+
var _this = this;
|
|
207
|
+
if (action.type === 'DISPATCH') {
|
|
208
|
+
if (action.payload.type === 'JUMP_TO_ACTION' ||
|
|
209
|
+
action.payload.type === 'JUMP_TO_STATE') {
|
|
210
|
+
/** @type {?} */
|
|
211
|
+
var prevState = JSON.parse(action.state);
|
|
212
|
+
this.store.reset(prevState);
|
|
213
|
+
}
|
|
214
|
+
else if (action.payload.type === 'TOGGLE_ACTION') {
|
|
215
|
+
console.warn('Skip is not supported at this time.');
|
|
216
|
+
}
|
|
217
|
+
else if (action.payload.type === 'IMPORT_STATE') {
|
|
218
|
+
var _a = action.payload.nextLiftedState, actionsById_1 = _a.actionsById, computedStates_1 = _a.computedStates, currentStateIndex = _a.currentStateIndex;
|
|
219
|
+
(/** @type {?} */ (this.devtoolsExtension)).init(computedStates_1[0].state);
|
|
220
|
+
Object.keys(actionsById_1)
|
|
221
|
+
.filter((/**
|
|
222
|
+
* @param {?} actionId
|
|
223
|
+
* @return {?}
|
|
224
|
+
*/
|
|
225
|
+
function (actionId) { return actionId !== '0'; }))
|
|
226
|
+
.forEach((/**
|
|
227
|
+
* @param {?} actionId
|
|
228
|
+
* @return {?}
|
|
229
|
+
*/
|
|
230
|
+
function (actionId) {
|
|
231
|
+
return (/** @type {?} */ (_this.devtoolsExtension)).send(actionsById_1[actionId], computedStates_1[actionId].state);
|
|
232
|
+
}));
|
|
233
|
+
this.store.reset(computedStates_1[currentStateIndex].state);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else if (action.type === 'ACTION') {
|
|
237
|
+
/** @type {?} */
|
|
238
|
+
var actionPayload = JSON.parse(action.payload);
|
|
239
|
+
this.store.dispatch(actionPayload);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
NgxsReduxDevtoolsPlugin.decorators = [
|
|
243
|
+
{ type: Injectable }
|
|
244
|
+
];
|
|
245
|
+
/** @nocollapse */
|
|
246
|
+
NgxsReduxDevtoolsPlugin.ctorParameters = function () { return [
|
|
247
|
+
{ type: undefined, decorators: [{ type: Inject, args: [NGXS_DEVTOOLS_OPTIONS,] }] },
|
|
248
|
+
{ type: Injector }
|
|
249
|
+
]; };
|
|
250
|
+
return NgxsReduxDevtoolsPlugin;
|
|
251
|
+
}());
|
|
252
|
+
if (false) {
|
|
253
|
+
/**
|
|
254
|
+
* @type {?}
|
|
255
|
+
* @private
|
|
256
|
+
*/
|
|
257
|
+
NgxsReduxDevtoolsPlugin.prototype.devtoolsExtension;
|
|
258
|
+
/**
|
|
259
|
+
* @type {?}
|
|
260
|
+
* @private
|
|
261
|
+
*/
|
|
262
|
+
NgxsReduxDevtoolsPlugin.prototype.windowObj;
|
|
263
|
+
/**
|
|
264
|
+
* @type {?}
|
|
265
|
+
* @private
|
|
266
|
+
*/
|
|
267
|
+
NgxsReduxDevtoolsPlugin.prototype._options;
|
|
268
|
+
/**
|
|
269
|
+
* @type {?}
|
|
270
|
+
* @private
|
|
271
|
+
*/
|
|
272
|
+
NgxsReduxDevtoolsPlugin.prototype._injector;
|
|
337
273
|
}
|
|
338
274
|
|
|
339
|
-
/**
|
|
340
|
-
* @fileoverview added by tsickle
|
|
341
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
342
|
-
*/
|
|
343
|
-
/**
|
|
344
|
-
* @param {?} options
|
|
345
|
-
* @return {?}
|
|
346
|
-
*/
|
|
347
|
-
function devtoolsOptionsFactory(options) {
|
|
348
|
-
return __assign({ name: 'NGXS' }, options);
|
|
349
|
-
}
|
|
350
|
-
/** @type {?} */
|
|
351
|
-
var USER_OPTIONS = new InjectionToken('USER_OPTIONS');
|
|
352
|
-
var NgxsReduxDevtoolsPluginModule = /** @class */ (function () {
|
|
353
|
-
function NgxsReduxDevtoolsPluginModule() {
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* @param {?=} options
|
|
357
|
-
* @return {?}
|
|
358
|
-
*/
|
|
359
|
-
NgxsReduxDevtoolsPluginModule.forRoot = /**
|
|
360
|
-
* @param {?=} options
|
|
361
|
-
* @return {?}
|
|
362
|
-
*/
|
|
363
|
-
function (options) {
|
|
364
|
-
return {
|
|
365
|
-
ngModule: NgxsReduxDevtoolsPluginModule,
|
|
366
|
-
providers: [
|
|
367
|
-
{
|
|
368
|
-
provide: NGXS_PLUGINS,
|
|
369
|
-
useClass: NgxsReduxDevtoolsPlugin,
|
|
370
|
-
multi: true
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
provide: USER_OPTIONS,
|
|
374
|
-
useValue: options
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
provide: NGXS_DEVTOOLS_OPTIONS,
|
|
378
|
-
useFactory: devtoolsOptionsFactory,
|
|
379
|
-
deps: [USER_OPTIONS]
|
|
380
|
-
}
|
|
381
|
-
]
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
NgxsReduxDevtoolsPluginModule.decorators = [
|
|
385
|
-
{ type: NgModule }
|
|
386
|
-
];
|
|
387
|
-
return NgxsReduxDevtoolsPluginModule;
|
|
275
|
+
/**
|
|
276
|
+
* @fileoverview added by tsickle
|
|
277
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* @param {?} options
|
|
281
|
+
* @return {?}
|
|
282
|
+
*/
|
|
283
|
+
function devtoolsOptionsFactory(options) {
|
|
284
|
+
return __assign({ name: 'NGXS' }, options);
|
|
285
|
+
}
|
|
286
|
+
/** @type {?} */
|
|
287
|
+
var USER_OPTIONS = new InjectionToken('USER_OPTIONS');
|
|
288
|
+
var NgxsReduxDevtoolsPluginModule = /** @class */ (function () {
|
|
289
|
+
function NgxsReduxDevtoolsPluginModule() {
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* @param {?=} options
|
|
293
|
+
* @return {?}
|
|
294
|
+
*/
|
|
295
|
+
NgxsReduxDevtoolsPluginModule.forRoot = /**
|
|
296
|
+
* @param {?=} options
|
|
297
|
+
* @return {?}
|
|
298
|
+
*/
|
|
299
|
+
function (options) {
|
|
300
|
+
return {
|
|
301
|
+
ngModule: NgxsReduxDevtoolsPluginModule,
|
|
302
|
+
providers: [
|
|
303
|
+
{
|
|
304
|
+
provide: NGXS_PLUGINS,
|
|
305
|
+
useClass: NgxsReduxDevtoolsPlugin,
|
|
306
|
+
multi: true
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
provide: USER_OPTIONS,
|
|
310
|
+
useValue: options
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
provide: NGXS_DEVTOOLS_OPTIONS,
|
|
314
|
+
useFactory: devtoolsOptionsFactory,
|
|
315
|
+
deps: [USER_OPTIONS]
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
NgxsReduxDevtoolsPluginModule.decorators = [
|
|
321
|
+
{ type: NgModule }
|
|
322
|
+
];
|
|
323
|
+
return NgxsReduxDevtoolsPluginModule;
|
|
388
324
|
}());
|
|
389
325
|
|
|
390
|
-
/**
|
|
391
|
-
* @fileoverview added by tsickle
|
|
392
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
326
|
+
/**
|
|
327
|
+
* @fileoverview added by tsickle
|
|
328
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
393
329
|
*/
|
|
394
330
|
|
|
395
|
-
/**
|
|
396
|
-
* @fileoverview added by tsickle
|
|
397
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
331
|
+
/**
|
|
332
|
+
* @fileoverview added by tsickle
|
|
333
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
398
334
|
*/
|
|
399
335
|
|
|
400
|
-
/**
|
|
401
|
-
* @fileoverview added by tsickle
|
|
402
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
336
|
+
/**
|
|
337
|
+
* @fileoverview added by tsickle
|
|
338
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
403
339
|
*/
|
|
404
340
|
|
|
405
341
|
export { NGXS_DEVTOOLS_OPTIONS, NgxsReduxDevtoolsPlugin, NgxsReduxDevtoolsPluginModule, devtoolsOptionsFactory as ɵa, USER_OPTIONS as ɵb };
|