@ngxs/hmr-plugin 3.7.6-dev.master-fb318b1 → 3.7.6-dev.master-dcdd391
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngxs-hmr-plugin.umd.js +411 -677
- package/bundles/ngxs-hmr-plugin.umd.js.map +1 -1
- package/esm2015/index.js +2 -6
- package/esm2015/ngxs-hmr-plugin.js +2 -6
- package/esm2015/src/actions/hmr-before-destroy.action.js +1 -15
- package/esm2015/src/actions/hmr-init.action.js +1 -15
- package/esm2015/src/hmr-bootstrap.js +7 -34
- package/esm2015/src/hmr-manager.js +17 -116
- package/esm2015/src/internal/hmr-lifecycle.js +13 -106
- package/esm2015/src/internal/hmr-options-builder.js +1 -17
- package/esm2015/src/internal/hmr-state-context-factory.js +15 -49
- package/esm2015/src/internal/hmr-storage.js +1 -24
- package/esm2015/src/public_api.js +1 -5
- package/esm2015/src/symbols.js +2 -62
- package/esm2015/src/utils/externals.js +1 -8
- package/esm2015/src/utils/internals.js +1 -12
- package/fesm2015/ngxs-hmr-plugin.js +46 -391
- package/fesm2015/ngxs-hmr-plugin.js.map +1 -1
- package/ngxs-hmr-plugin.d.ts +1 -0
- package/package.json +3 -6
- package/src/actions/hmr-before-destroy.action.d.ts +1 -1
- package/src/actions/hmr-init.action.d.ts +1 -1
- package/src/hmr-manager.d.ts +2 -2
- package/src/internal/hmr-storage.d.ts +1 -1
- package/bundles/ngxs-hmr-plugin.umd.min.js +0 -16
- package/bundles/ngxs-hmr-plugin.umd.min.js.map +0 -1
- package/esm5/index.js +0 -9
- package/esm5/ngxs-hmr-plugin.js +0 -9
- package/esm5/src/actions/hmr-before-destroy.action.js +0 -27
- package/esm5/src/actions/hmr-init.action.js +0 -27
- package/esm5/src/hmr-bootstrap.js +0 -63
- package/esm5/src/hmr-manager.js +0 -222
- package/esm5/src/internal/hmr-lifecycle.js +0 -182
- package/esm5/src/internal/hmr-options-builder.js +0 -31
- package/esm5/src/internal/hmr-state-context-factory.js +0 -86
- package/esm5/src/internal/hmr-storage.js +0 -48
- package/esm5/src/public_api.js +0 -9
- package/esm5/src/symbols.js +0 -62
- package/esm5/src/utils/externals.js +0 -11
- package/esm5/src/utils/internals.js +0 -22
- package/fesm5/ngxs-hmr-plugin.js +0 -708
- package/fesm5/ngxs-hmr-plugin.js.map +0 -1
- package/ngxs-hmr-plugin.metadata.json +0 -1
|
@@ -1,293 +1,368 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store/internals'), require('@ngxs/store'), require('@ngxs/store/operators')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@ngxs/hmr-plugin', ['exports', '@angular/core', '@ngxs/store/internals', '@ngxs/store', '@ngxs/store/operators'], factory) :
|
|
4
|
-
(global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs[
|
|
5
|
-
}(this, function (exports, core, internals, store, operators) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs["hmr-plugin"] = {}), global.ng.core, global["ngxs-store-internals"], global["ngxs-store"], global["ngxs-store-operators"]));
|
|
5
|
+
})(this, (function (exports, core, internals, store, operators) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics = function(d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
extendStatics(d, b);
|
|
32
|
-
function __() { this.constructor = d; }
|
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var __assign = function() {
|
|
37
|
-
__assign = Object.assign || function __assign(t) {
|
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
44
|
-
return __assign.apply(this, arguments);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function __rest(s, e) {
|
|
48
|
-
var t = {};
|
|
49
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
-
t[p] = s[p];
|
|
51
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
-
t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function __decorate(decorators, target, key, desc) {
|
|
60
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
61
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
62
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function __param(paramIndex, decorator) {
|
|
67
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function __metadata(metadataKey, metadataValue) {
|
|
71
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
75
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
76
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
77
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
78
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
79
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
80
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function __generator(thisArg, body) {
|
|
85
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
86
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
87
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
88
|
-
function step(op) {
|
|
89
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
-
while (_) try {
|
|
91
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
92
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
93
|
-
switch (op[0]) {
|
|
94
|
-
case 0: case 1: t = op; break;
|
|
95
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
96
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
97
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
98
|
-
default:
|
|
99
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
100
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
101
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
102
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
103
|
-
if (t[2]) _.ops.pop();
|
|
104
|
-
_.trys.pop(); continue;
|
|
105
|
-
}
|
|
106
|
-
op = body.call(thisArg, _);
|
|
107
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
108
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function __createBinding(o, m, k, k2) {
|
|
113
|
-
if (k2 === undefined) k2 = k;
|
|
114
|
-
o[k2] = m[k];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function __exportStar(m, exports) {
|
|
118
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function __values(o) {
|
|
122
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
123
|
-
if (m) return m.call(o);
|
|
124
|
-
if (o && typeof o.length === "number") return {
|
|
125
|
-
next: function () {
|
|
126
|
-
if (o && i >= o.length) o = void 0;
|
|
127
|
-
return { value: o && o[i++], done: !o };
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function __read(o, n) {
|
|
134
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
135
|
-
if (!m) return o;
|
|
136
|
-
var i = m.call(o), r, ar = [], e;
|
|
137
|
-
try {
|
|
138
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
139
|
-
}
|
|
140
|
-
catch (error) { e = { error: error }; }
|
|
141
|
-
finally {
|
|
142
|
-
try {
|
|
143
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
144
|
-
}
|
|
145
|
-
finally { if (e) throw e.error; }
|
|
146
|
-
}
|
|
147
|
-
return ar;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function __spread() {
|
|
151
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
152
|
-
ar = ar.concat(__read(arguments[i]));
|
|
153
|
-
return ar;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function __spreadArrays() {
|
|
157
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
158
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
159
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
160
|
-
r[k] = a[j];
|
|
161
|
-
return r;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
function __await(v) {
|
|
165
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
169
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
170
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
171
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
172
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
173
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
174
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
175
|
-
function fulfill(value) { resume("next", value); }
|
|
176
|
-
function reject(value) { resume("throw", value); }
|
|
177
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function __asyncDelegator(o) {
|
|
181
|
-
var i, p;
|
|
182
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
183
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function __asyncValues(o) {
|
|
187
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
188
|
-
var m = o[Symbol.asyncIterator], i;
|
|
189
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
190
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
191
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function __makeTemplateObject(cooked, raw) {
|
|
195
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
196
|
-
return cooked;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
function __importStar(mod) {
|
|
200
|
-
if (mod && mod.__esModule) return mod;
|
|
201
|
-
var result = {};
|
|
202
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
203
|
-
result.default = mod;
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function __importDefault(mod) {
|
|
208
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
212
|
-
if (!privateMap.has(receiver)) {
|
|
213
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
214
|
-
}
|
|
215
|
-
return privateMap.get(receiver);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
219
|
-
if (!privateMap.has(receiver)) {
|
|
220
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
221
|
-
}
|
|
222
|
-
privateMap.set(receiver, value);
|
|
223
|
-
return value;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @fileoverview added by tsickle
|
|
228
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
229
|
-
*/
|
|
230
7
|
var HmrInitAction = /** @class */ (function () {
|
|
231
8
|
function HmrInitAction(payload) {
|
|
232
9
|
this.payload = payload;
|
|
233
10
|
}
|
|
234
11
|
Object.defineProperty(HmrInitAction, "type", {
|
|
235
|
-
get:
|
|
236
|
-
* @return {?}
|
|
237
|
-
*/
|
|
238
|
-
function () {
|
|
12
|
+
get: function () {
|
|
239
13
|
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
240
14
|
return '@@HMR_INIT';
|
|
241
15
|
},
|
|
242
|
-
enumerable:
|
|
16
|
+
enumerable: false,
|
|
243
17
|
configurable: true
|
|
244
18
|
});
|
|
245
19
|
return HmrInitAction;
|
|
246
20
|
}());
|
|
247
|
-
if (false) {
|
|
248
|
-
/** @type {?} */
|
|
249
|
-
HmrInitAction.prototype.payload;
|
|
250
|
-
}
|
|
251
21
|
|
|
252
|
-
/**
|
|
253
|
-
* @fileoverview added by tsickle
|
|
254
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
255
|
-
*/
|
|
256
22
|
var HmrBeforeDestroyAction = /** @class */ (function () {
|
|
257
23
|
function HmrBeforeDestroyAction(payload) {
|
|
258
24
|
this.payload = payload;
|
|
259
25
|
}
|
|
260
26
|
Object.defineProperty(HmrBeforeDestroyAction, "type", {
|
|
261
|
-
get:
|
|
262
|
-
* @return {?}
|
|
263
|
-
*/
|
|
264
|
-
function () {
|
|
27
|
+
get: function () {
|
|
265
28
|
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
266
29
|
return '@@HMR_BEFORE_DESTROY';
|
|
267
30
|
},
|
|
268
|
-
enumerable:
|
|
31
|
+
enumerable: false,
|
|
269
32
|
configurable: true
|
|
270
33
|
});
|
|
271
34
|
return HmrBeforeDestroyAction;
|
|
272
35
|
}());
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
36
|
+
|
|
37
|
+
/******************************************************************************
|
|
38
|
+
Copyright (c) Microsoft Corporation.
|
|
39
|
+
|
|
40
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
41
|
+
purpose with or without fee is hereby granted.
|
|
42
|
+
|
|
43
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
44
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
45
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
46
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
47
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
48
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
49
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
50
|
+
***************************************************************************** */
|
|
51
|
+
/* global Reflect, Promise */
|
|
52
|
+
var extendStatics = function (d, b) {
|
|
53
|
+
extendStatics = Object.setPrototypeOf ||
|
|
54
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
55
|
+
function (d, b) { for (var p in b)
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
57
|
+
d[p] = b[p]; };
|
|
58
|
+
return extendStatics(d, b);
|
|
59
|
+
};
|
|
60
|
+
function __extends(d, b) {
|
|
61
|
+
if (typeof b !== "function" && b !== null)
|
|
62
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
63
|
+
extendStatics(d, b);
|
|
64
|
+
function __() { this.constructor = d; }
|
|
65
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
66
|
+
}
|
|
67
|
+
var __assign = function () {
|
|
68
|
+
__assign = Object.assign || function __assign(t) {
|
|
69
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
70
|
+
s = arguments[i];
|
|
71
|
+
for (var p in s)
|
|
72
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
73
|
+
t[p] = s[p];
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
};
|
|
77
|
+
return __assign.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
function __rest(s, e) {
|
|
80
|
+
var t = {};
|
|
81
|
+
for (var p in s)
|
|
82
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
83
|
+
t[p] = s[p];
|
|
84
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
85
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
86
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
87
|
+
t[p[i]] = s[p[i]];
|
|
88
|
+
}
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
function __decorate(decorators, target, key, desc) {
|
|
92
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
93
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
94
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
95
|
+
else
|
|
96
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
97
|
+
if (d = decorators[i])
|
|
98
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
99
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
100
|
+
}
|
|
101
|
+
function __param(paramIndex, decorator) {
|
|
102
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
103
|
+
}
|
|
104
|
+
function __metadata(metadataKey, metadataValue) {
|
|
105
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
106
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
107
|
+
}
|
|
108
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
109
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
110
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
111
|
+
function fulfilled(value) { try {
|
|
112
|
+
step(generator.next(value));
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
reject(e);
|
|
116
|
+
} }
|
|
117
|
+
function rejected(value) { try {
|
|
118
|
+
step(generator["throw"](value));
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
reject(e);
|
|
122
|
+
} }
|
|
123
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
124
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function __generator(thisArg, body) {
|
|
128
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
129
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
130
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
131
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
132
|
+
function step(op) {
|
|
133
|
+
if (f)
|
|
134
|
+
throw new TypeError("Generator is already executing.");
|
|
135
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
136
|
+
try {
|
|
137
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
138
|
+
return t;
|
|
139
|
+
if (y = 0, t)
|
|
140
|
+
op = [op[0] & 2, t.value];
|
|
141
|
+
switch (op[0]) {
|
|
142
|
+
case 0:
|
|
143
|
+
case 1:
|
|
144
|
+
t = op;
|
|
145
|
+
break;
|
|
146
|
+
case 4:
|
|
147
|
+
_.label++;
|
|
148
|
+
return { value: op[1], done: false };
|
|
149
|
+
case 5:
|
|
150
|
+
_.label++;
|
|
151
|
+
y = op[1];
|
|
152
|
+
op = [0];
|
|
153
|
+
continue;
|
|
154
|
+
case 7:
|
|
155
|
+
op = _.ops.pop();
|
|
156
|
+
_.trys.pop();
|
|
157
|
+
continue;
|
|
158
|
+
default:
|
|
159
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
160
|
+
_ = 0;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
164
|
+
_.label = op[1];
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
168
|
+
_.label = t[1];
|
|
169
|
+
t = op;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
if (t && _.label < t[2]) {
|
|
173
|
+
_.label = t[2];
|
|
174
|
+
_.ops.push(op);
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
if (t[2])
|
|
178
|
+
_.ops.pop();
|
|
179
|
+
_.trys.pop();
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
op = body.call(thisArg, _);
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
op = [6, e];
|
|
186
|
+
y = 0;
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
f = t = 0;
|
|
190
|
+
}
|
|
191
|
+
if (op[0] & 5)
|
|
192
|
+
throw op[1];
|
|
193
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
197
|
+
if (k2 === undefined)
|
|
198
|
+
k2 = k;
|
|
199
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
200
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
201
|
+
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
202
|
+
}
|
|
203
|
+
Object.defineProperty(o, k2, desc);
|
|
204
|
+
}) : (function (o, m, k, k2) {
|
|
205
|
+
if (k2 === undefined)
|
|
206
|
+
k2 = k;
|
|
207
|
+
o[k2] = m[k];
|
|
208
|
+
});
|
|
209
|
+
function __exportStar(m, o) {
|
|
210
|
+
for (var p in m)
|
|
211
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
212
|
+
__createBinding(o, m, p);
|
|
213
|
+
}
|
|
214
|
+
function __values(o) {
|
|
215
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
216
|
+
if (m)
|
|
217
|
+
return m.call(o);
|
|
218
|
+
if (o && typeof o.length === "number")
|
|
219
|
+
return {
|
|
220
|
+
next: function () {
|
|
221
|
+
if (o && i >= o.length)
|
|
222
|
+
o = void 0;
|
|
223
|
+
return { value: o && o[i++], done: !o };
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
227
|
+
}
|
|
228
|
+
function __read(o, n) {
|
|
229
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
230
|
+
if (!m)
|
|
231
|
+
return o;
|
|
232
|
+
var i = m.call(o), r, ar = [], e;
|
|
233
|
+
try {
|
|
234
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
235
|
+
ar.push(r.value);
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
e = { error: error };
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
try {
|
|
242
|
+
if (r && !r.done && (m = i["return"]))
|
|
243
|
+
m.call(i);
|
|
244
|
+
}
|
|
245
|
+
finally {
|
|
246
|
+
if (e)
|
|
247
|
+
throw e.error;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return ar;
|
|
251
|
+
}
|
|
252
|
+
/** @deprecated */
|
|
253
|
+
function __spread() {
|
|
254
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
255
|
+
ar = ar.concat(__read(arguments[i]));
|
|
256
|
+
return ar;
|
|
257
|
+
}
|
|
258
|
+
/** @deprecated */
|
|
259
|
+
function __spreadArrays() {
|
|
260
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
261
|
+
s += arguments[i].length;
|
|
262
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
263
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
264
|
+
r[k] = a[j];
|
|
265
|
+
return r;
|
|
266
|
+
}
|
|
267
|
+
function __spreadArray(to, from, pack) {
|
|
268
|
+
if (pack || arguments.length === 2)
|
|
269
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
270
|
+
if (ar || !(i in from)) {
|
|
271
|
+
if (!ar)
|
|
272
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
273
|
+
ar[i] = from[i];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
277
|
+
}
|
|
278
|
+
function __await(v) {
|
|
279
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
280
|
+
}
|
|
281
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
282
|
+
if (!Symbol.asyncIterator)
|
|
283
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
284
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
285
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
286
|
+
function verb(n) { if (g[n])
|
|
287
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
288
|
+
function resume(n, v) { try {
|
|
289
|
+
step(g[n](v));
|
|
290
|
+
}
|
|
291
|
+
catch (e) {
|
|
292
|
+
settle(q[0][3], e);
|
|
293
|
+
} }
|
|
294
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
295
|
+
function fulfill(value) { resume("next", value); }
|
|
296
|
+
function reject(value) { resume("throw", value); }
|
|
297
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
298
|
+
resume(q[0][0], q[0][1]); }
|
|
299
|
+
}
|
|
300
|
+
function __asyncDelegator(o) {
|
|
301
|
+
var i, p;
|
|
302
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
303
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
304
|
+
}
|
|
305
|
+
function __asyncValues(o) {
|
|
306
|
+
if (!Symbol.asyncIterator)
|
|
307
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
308
|
+
var m = o[Symbol.asyncIterator], i;
|
|
309
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
310
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
311
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
312
|
+
}
|
|
313
|
+
function __makeTemplateObject(cooked, raw) {
|
|
314
|
+
if (Object.defineProperty) {
|
|
315
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
cooked.raw = raw;
|
|
319
|
+
}
|
|
320
|
+
return cooked;
|
|
321
|
+
}
|
|
322
|
+
;
|
|
323
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
324
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
325
|
+
}) : function (o, v) {
|
|
326
|
+
o["default"] = v;
|
|
327
|
+
};
|
|
328
|
+
function __importStar(mod) {
|
|
329
|
+
if (mod && mod.__esModule)
|
|
330
|
+
return mod;
|
|
331
|
+
var result = {};
|
|
332
|
+
if (mod != null)
|
|
333
|
+
for (var k in mod)
|
|
334
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
335
|
+
__createBinding(result, mod, k);
|
|
336
|
+
__setModuleDefault(result, mod);
|
|
337
|
+
return result;
|
|
338
|
+
}
|
|
339
|
+
function __importDefault(mod) {
|
|
340
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
341
|
+
}
|
|
342
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
343
|
+
if (kind === "a" && !f)
|
|
344
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
345
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
346
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
347
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
348
|
+
}
|
|
349
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
350
|
+
if (kind === "m")
|
|
351
|
+
throw new TypeError("Private method is not writable");
|
|
352
|
+
if (kind === "a" && !f)
|
|
353
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
354
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
355
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
356
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
357
|
+
}
|
|
358
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
359
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
360
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
361
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
276
362
|
}
|
|
277
363
|
|
|
278
|
-
/**
|
|
279
|
-
* @fileoverview added by tsickle
|
|
280
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
281
|
-
*/
|
|
282
|
-
/**
|
|
283
|
-
* @template T, S
|
|
284
|
-
*/
|
|
285
|
-
var /**
|
|
286
|
-
* @template T, S
|
|
287
|
-
*/
|
|
288
|
-
HmrStateContextFactory = /** @class */ (function () {
|
|
364
|
+
var HmrStateContextFactory = /** @class */ (function () {
|
|
289
365
|
function HmrStateContextFactory(module) {
|
|
290
|
-
/** @type {?} */
|
|
291
366
|
var store$1 = module.injector.get(store.Store, undefined);
|
|
292
367
|
if (!store$1) {
|
|
293
368
|
throw new Error('Store not found, maybe you forgot to import the NgxsModule');
|
|
@@ -298,103 +373,45 @@
|
|
|
298
373
|
* @description
|
|
299
374
|
* must be taken out into @ngxs/store/internals
|
|
300
375
|
*/
|
|
301
|
-
|
|
302
|
-
* \@description
|
|
303
|
-
* must be taken out into \@ngxs/store/internals
|
|
304
|
-
* @return {?}
|
|
305
|
-
*/
|
|
306
|
-
HmrStateContextFactory.prototype.createStateContext = /**
|
|
307
|
-
* \@description
|
|
308
|
-
* must be taken out into \@ngxs/store/internals
|
|
309
|
-
* @return {?}
|
|
310
|
-
*/
|
|
311
|
-
function () {
|
|
376
|
+
HmrStateContextFactory.prototype.createStateContext = function () {
|
|
312
377
|
var _this = this;
|
|
313
378
|
return {
|
|
314
|
-
dispatch: (
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
*/
|
|
318
|
-
function (actions) { return (/** @type {?} */ (_this.store)).dispatch(actions); }),
|
|
319
|
-
getState: (/**
|
|
320
|
-
* @return {?}
|
|
321
|
-
*/
|
|
322
|
-
function () { return (/** @type {?} */ ((/** @type {?} */ (_this.store)).snapshot())); }),
|
|
323
|
-
setState: (/**
|
|
324
|
-
* @param {?} val
|
|
325
|
-
* @return {?}
|
|
326
|
-
*/
|
|
327
|
-
function (val) {
|
|
379
|
+
dispatch: function (actions) { return _this.store.dispatch(actions); },
|
|
380
|
+
getState: function () { return _this.store.snapshot(); },
|
|
381
|
+
setState: function (val) {
|
|
328
382
|
if (operators.isStateOperator(val)) {
|
|
329
|
-
|
|
330
|
-
var currentState = (/** @type {?} */ (_this.store)).snapshot();
|
|
383
|
+
var currentState = _this.store.snapshot();
|
|
331
384
|
val = val(currentState);
|
|
332
385
|
}
|
|
333
|
-
|
|
334
|
-
return
|
|
335
|
-
}
|
|
336
|
-
patchState: (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
function (val) {
|
|
341
|
-
/** @type {?} */
|
|
342
|
-
var currentState = (/** @type {?} */ (_this.store)).snapshot();
|
|
343
|
-
/** @type {?} */
|
|
344
|
-
var newState = __assign({}, currentState, ((/** @type {?} */ (val))));
|
|
345
|
-
(/** @type {?} */ (_this.store)).reset(newState);
|
|
386
|
+
_this.store.reset(val);
|
|
387
|
+
return val;
|
|
388
|
+
},
|
|
389
|
+
patchState: function (val) {
|
|
390
|
+
var currentState = _this.store.snapshot();
|
|
391
|
+
var newState = Object.assign(Object.assign({}, currentState), val);
|
|
392
|
+
_this.store.reset(newState);
|
|
346
393
|
return newState;
|
|
347
|
-
}
|
|
394
|
+
}
|
|
348
395
|
};
|
|
349
396
|
};
|
|
350
397
|
return HmrStateContextFactory;
|
|
351
398
|
}());
|
|
352
|
-
if (false) {
|
|
353
|
-
/** @type {?} */
|
|
354
|
-
HmrStateContextFactory.prototype.store;
|
|
355
|
-
}
|
|
356
399
|
|
|
357
|
-
/**
|
|
358
|
-
* @fileoverview added by tsickle
|
|
359
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
360
|
-
*/
|
|
361
400
|
var HmrOptionBuilder = /** @class */ (function () {
|
|
362
401
|
function HmrOptionBuilder(_a) {
|
|
363
402
|
var deferTime = _a.deferTime, autoClearLogs = _a.autoClearLogs;
|
|
364
403
|
this.deferTime = deferTime || 100;
|
|
365
404
|
this.autoClearLogs = autoClearLogs === undefined ? true : autoClearLogs;
|
|
366
405
|
}
|
|
367
|
-
|
|
368
|
-
* @return {?}
|
|
369
|
-
*/
|
|
370
|
-
HmrOptionBuilder.prototype.clearLogs = /**
|
|
371
|
-
* @return {?}
|
|
372
|
-
*/
|
|
373
|
-
function () {
|
|
406
|
+
HmrOptionBuilder.prototype.clearLogs = function () {
|
|
374
407
|
if (this.autoClearLogs) {
|
|
375
408
|
console.clear();
|
|
376
409
|
}
|
|
377
410
|
};
|
|
378
411
|
return HmrOptionBuilder;
|
|
379
412
|
}());
|
|
380
|
-
if (false) {
|
|
381
|
-
/** @type {?} */
|
|
382
|
-
HmrOptionBuilder.prototype.deferTime;
|
|
383
|
-
/** @type {?} */
|
|
384
|
-
HmrOptionBuilder.prototype.autoClearLogs;
|
|
385
|
-
}
|
|
386
413
|
|
|
387
|
-
/**
|
|
388
|
-
* @fileoverview added by tsickle
|
|
389
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
390
|
-
*/
|
|
391
|
-
/**
|
|
392
|
-
* @template T, S
|
|
393
|
-
*/
|
|
394
|
-
var /**
|
|
395
|
-
* @template T, S
|
|
396
|
-
*/
|
|
397
|
-
HmrLifecycle = /** @class */ (function () {
|
|
414
|
+
var HmrLifecycle = /** @class */ (function () {
|
|
398
415
|
function HmrLifecycle(ngAppModule, bootstrap, storage, context, options) {
|
|
399
416
|
this.ngAppModule = ngAppModule;
|
|
400
417
|
this.bootstrap = bootstrap;
|
|
@@ -402,60 +419,25 @@
|
|
|
402
419
|
this.context = context;
|
|
403
420
|
this.options = options;
|
|
404
421
|
}
|
|
405
|
-
|
|
406
|
-
* @param {?} hmrAfterOnInit
|
|
407
|
-
* @return {?}
|
|
408
|
-
*/
|
|
409
|
-
HmrLifecycle.prototype.hmrNgxsStoreOnInit = /**
|
|
410
|
-
* @param {?} hmrAfterOnInit
|
|
411
|
-
* @return {?}
|
|
412
|
-
*/
|
|
413
|
-
function (hmrAfterOnInit) {
|
|
414
|
-
/** @type {?} */
|
|
422
|
+
HmrLifecycle.prototype.hmrNgxsStoreOnInit = function (hmrAfterOnInit) {
|
|
415
423
|
var moduleHmrInit = this.getModuleHmrInitCallback();
|
|
416
424
|
moduleHmrInit = moduleHmrInit.bind(this.ngAppModule);
|
|
417
425
|
this.detectIvyWithJIT();
|
|
418
|
-
this.stateEventLoop((
|
|
419
|
-
* @param {?} ctx
|
|
420
|
-
* @param {?} state
|
|
421
|
-
* @return {?}
|
|
422
|
-
*/
|
|
423
|
-
function (ctx, state) {
|
|
426
|
+
this.stateEventLoop(function (ctx, state) {
|
|
424
427
|
moduleHmrInit(ctx, state);
|
|
425
428
|
hmrAfterOnInit(ctx, state);
|
|
426
|
-
})
|
|
429
|
+
});
|
|
427
430
|
};
|
|
428
|
-
|
|
429
|
-
* @private
|
|
430
|
-
* @return {?}
|
|
431
|
-
*/
|
|
432
|
-
HmrLifecycle.prototype.getModuleHmrInitCallback = /**
|
|
433
|
-
* @private
|
|
434
|
-
* @return {?}
|
|
435
|
-
*/
|
|
436
|
-
function () {
|
|
431
|
+
HmrLifecycle.prototype.getModuleHmrInitCallback = function () {
|
|
437
432
|
if (typeof this.ngAppModule.hmrNgxsStoreOnInit === 'function') {
|
|
438
433
|
return this.ngAppModule.hmrNgxsStoreOnInit;
|
|
439
434
|
}
|
|
440
|
-
return (
|
|
441
|
-
* @param {?} ctx
|
|
442
|
-
* @param {?} state
|
|
443
|
-
* @return {?}
|
|
444
|
-
*/
|
|
445
|
-
function defaultModuleHmrInit(ctx, state) {
|
|
435
|
+
return function defaultModuleHmrInit(ctx, state) {
|
|
446
436
|
ctx.patchState(state);
|
|
447
|
-
}
|
|
437
|
+
};
|
|
448
438
|
};
|
|
449
|
-
|
|
450
|
-
* @return {?}
|
|
451
|
-
*/
|
|
452
|
-
HmrLifecycle.prototype.hmrNgxsStoreBeforeOnDestroy = /**
|
|
453
|
-
* @return {?}
|
|
454
|
-
*/
|
|
455
|
-
function () {
|
|
456
|
-
/** @type {?} */
|
|
439
|
+
HmrLifecycle.prototype.hmrNgxsStoreBeforeOnDestroy = function () {
|
|
457
440
|
var state = {};
|
|
458
|
-
/** @type {?} */
|
|
459
441
|
var ctx = this.context.createStateContext();
|
|
460
442
|
if (typeof this.ngAppModule.hmrNgxsStoreBeforeOnDestroy === 'function') {
|
|
461
443
|
state = this.ngAppModule.hmrNgxsStoreBeforeOnDestroy(ctx);
|
|
@@ -466,66 +448,29 @@
|
|
|
466
448
|
ctx.dispatch(new HmrBeforeDestroyAction(state));
|
|
467
449
|
return state;
|
|
468
450
|
};
|
|
469
|
-
|
|
470
|
-
* @private
|
|
471
|
-
* @param {?} callback
|
|
472
|
-
* @return {?}
|
|
473
|
-
*/
|
|
474
|
-
HmrLifecycle.prototype.stateEventLoop = /**
|
|
475
|
-
* @private
|
|
476
|
-
* @param {?} callback
|
|
477
|
-
* @return {?}
|
|
478
|
-
*/
|
|
479
|
-
function (callback) {
|
|
451
|
+
HmrLifecycle.prototype.stateEventLoop = function (callback) {
|
|
480
452
|
var _this = this;
|
|
481
453
|
if (!this.storage.hasData())
|
|
482
454
|
return;
|
|
483
|
-
/** @type {?} */
|
|
484
455
|
var appBootstrapped$ = this.bootstrap.appBootstrapped$;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
* @param {?} state
|
|
488
|
-
* @return {?}
|
|
489
|
-
*/
|
|
490
|
-
function (state) { return state; }));
|
|
491
|
-
appBootstrapped$.subscribe((/**
|
|
492
|
-
* @return {?}
|
|
493
|
-
*/
|
|
494
|
-
function () {
|
|
495
|
-
/** @type {?} */
|
|
456
|
+
var state$ = this.context.store.select(function (state) { return state; });
|
|
457
|
+
appBootstrapped$.subscribe(function () {
|
|
496
458
|
var eventId;
|
|
497
|
-
|
|
498
|
-
var storeEventId = state$.subscribe((/**
|
|
499
|
-
* @return {?}
|
|
500
|
-
*/
|
|
501
|
-
function () {
|
|
459
|
+
var storeEventId = state$.subscribe(function () {
|
|
502
460
|
// setTimeout used for zone detection after set hmr state
|
|
503
461
|
clearInterval(eventId);
|
|
504
|
-
eventId = window.setTimeout((
|
|
505
|
-
* @return {?}
|
|
506
|
-
*/
|
|
507
|
-
function () {
|
|
462
|
+
eventId = window.setTimeout(function () {
|
|
508
463
|
// close check on the message queue
|
|
509
464
|
storeEventId.unsubscribe();
|
|
510
465
|
// if events are no longer running on the call stack,
|
|
511
466
|
// then we can update the state
|
|
512
|
-
callback(_this.context.createStateContext(),
|
|
513
|
-
}
|
|
514
|
-
})
|
|
515
|
-
})
|
|
467
|
+
callback(_this.context.createStateContext(), _this.storage.snapshot);
|
|
468
|
+
}, _this.options.deferTime);
|
|
469
|
+
});
|
|
470
|
+
});
|
|
516
471
|
};
|
|
517
|
-
|
|
518
|
-
* @private
|
|
519
|
-
* @return {?}
|
|
520
|
-
*/
|
|
521
|
-
HmrLifecycle.prototype.detectIvyWithJIT = /**
|
|
522
|
-
* @private
|
|
523
|
-
* @return {?}
|
|
524
|
-
*/
|
|
525
|
-
function () {
|
|
526
|
-
/** @type {?} */
|
|
472
|
+
HmrLifecycle.prototype.detectIvyWithJIT = function () {
|
|
527
473
|
var jit = this.ngAppModule.constructor.hasOwnProperty('__annotations__');
|
|
528
|
-
/** @type {?} */
|
|
529
474
|
var ivy = this.ngAppModule.constructor.hasOwnProperty('ɵmod');
|
|
530
475
|
if (jit && ivy) {
|
|
531
476
|
throw new Error("@ngxs/hmr-plugin doesn't work with JIT mode in Angular Ivy. Please use AOT mode.");
|
|
@@ -533,92 +478,37 @@
|
|
|
533
478
|
};
|
|
534
479
|
return HmrLifecycle;
|
|
535
480
|
}());
|
|
536
|
-
if (false) {
|
|
537
|
-
/**
|
|
538
|
-
* @type {?}
|
|
539
|
-
* @private
|
|
540
|
-
*/
|
|
541
|
-
HmrLifecycle.prototype.ngAppModule;
|
|
542
|
-
/**
|
|
543
|
-
* @type {?}
|
|
544
|
-
* @private
|
|
545
|
-
*/
|
|
546
|
-
HmrLifecycle.prototype.bootstrap;
|
|
547
|
-
/**
|
|
548
|
-
* @type {?}
|
|
549
|
-
* @private
|
|
550
|
-
*/
|
|
551
|
-
HmrLifecycle.prototype.storage;
|
|
552
|
-
/**
|
|
553
|
-
* @type {?}
|
|
554
|
-
* @private
|
|
555
|
-
*/
|
|
556
|
-
HmrLifecycle.prototype.context;
|
|
557
|
-
/**
|
|
558
|
-
* @type {?}
|
|
559
|
-
* @private
|
|
560
|
-
*/
|
|
561
|
-
HmrLifecycle.prototype.options;
|
|
562
|
-
}
|
|
563
481
|
|
|
564
|
-
/**
|
|
565
|
-
* @fileoverview added by tsickle
|
|
566
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
567
|
-
*/
|
|
568
|
-
/**
|
|
569
|
-
* @template T, S
|
|
570
|
-
*/
|
|
571
|
-
var /**
|
|
572
|
-
* @template T, S
|
|
573
|
-
*/
|
|
574
|
-
HmrManager = /** @class */ (function () {
|
|
482
|
+
var HmrManager = /** @class */ (function () {
|
|
575
483
|
function HmrManager(options, storage) {
|
|
576
484
|
this.storage = storage;
|
|
577
485
|
this.optionsBuilder = new HmrOptionBuilder(options);
|
|
578
486
|
}
|
|
579
487
|
Object.defineProperty(HmrManager.prototype, "applicationRef", {
|
|
580
|
-
get:
|
|
581
|
-
* @private
|
|
582
|
-
* @return {?}
|
|
583
|
-
*/
|
|
584
|
-
function () {
|
|
488
|
+
get: function () {
|
|
585
489
|
return this.ngModule.injector.get(core.ApplicationRef);
|
|
586
490
|
},
|
|
587
|
-
enumerable:
|
|
491
|
+
enumerable: false,
|
|
588
492
|
configurable: true
|
|
589
493
|
});
|
|
590
494
|
Object.defineProperty(HmrManager.prototype, "bootstrap", {
|
|
591
|
-
get:
|
|
592
|
-
* @private
|
|
593
|
-
* @return {?}
|
|
594
|
-
*/
|
|
595
|
-
function () {
|
|
495
|
+
get: function () {
|
|
596
496
|
return this.ngModule.injector.get(internals.NgxsBootstrapper);
|
|
597
497
|
},
|
|
598
|
-
enumerable:
|
|
498
|
+
enumerable: false,
|
|
599
499
|
configurable: true
|
|
600
500
|
});
|
|
601
|
-
|
|
602
|
-
* @param {?} bootstrapFn
|
|
603
|
-
* @param {?} tick
|
|
604
|
-
* @return {?}
|
|
605
|
-
*/
|
|
606
|
-
HmrManager.prototype.hmrModule = /**
|
|
607
|
-
* @param {?} bootstrapFn
|
|
608
|
-
* @param {?} tick
|
|
609
|
-
* @return {?}
|
|
610
|
-
*/
|
|
611
|
-
function (bootstrapFn, tick) {
|
|
501
|
+
HmrManager.prototype.hmrModule = function (bootstrapFn, tick) {
|
|
612
502
|
return __awaiter(this, void 0, void 0, function () {
|
|
613
|
-
var
|
|
614
|
-
return __generator(this, function (
|
|
615
|
-
switch (
|
|
503
|
+
var _b;
|
|
504
|
+
return __generator(this, function (_c) {
|
|
505
|
+
switch (_c.label) {
|
|
616
506
|
case 0:
|
|
617
507
|
internals.InitialState.set(this.storage.snapshot);
|
|
618
|
-
|
|
508
|
+
_b = this;
|
|
619
509
|
return [4 /*yield*/, bootstrapFn()];
|
|
620
510
|
case 1:
|
|
621
|
-
|
|
511
|
+
_b.ngModule = _c.sent();
|
|
622
512
|
this.context = new HmrStateContextFactory(this.ngModule);
|
|
623
513
|
this.lifecycle = this.createLifecycle();
|
|
624
514
|
tick();
|
|
@@ -628,237 +518,91 @@
|
|
|
628
518
|
});
|
|
629
519
|
});
|
|
630
520
|
};
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
*/
|
|
634
|
-
HmrManager.prototype.beforeModuleBootstrap = /**
|
|
635
|
-
* @return {?}
|
|
636
|
-
*/
|
|
637
|
-
function () {
|
|
638
|
-
this.lifecycle.hmrNgxsStoreOnInit((/**
|
|
639
|
-
* @param {?} ctx
|
|
640
|
-
* @param {?} state
|
|
641
|
-
* @return {?}
|
|
642
|
-
*/
|
|
643
|
-
function (ctx, state) {
|
|
521
|
+
HmrManager.prototype.beforeModuleBootstrap = function () {
|
|
522
|
+
this.lifecycle.hmrNgxsStoreOnInit(function (ctx, state) {
|
|
644
523
|
ctx.dispatch(new HmrInitAction(state));
|
|
645
|
-
})
|
|
524
|
+
});
|
|
646
525
|
};
|
|
647
|
-
|
|
648
|
-
* @return {?}
|
|
649
|
-
*/
|
|
650
|
-
HmrManager.prototype.beforeModuleOnDestroy = /**
|
|
651
|
-
* @return {?}
|
|
652
|
-
*/
|
|
653
|
-
function () {
|
|
526
|
+
HmrManager.prototype.beforeModuleOnDestroy = function () {
|
|
654
527
|
this.optionsBuilder.clearLogs();
|
|
655
528
|
return this.lifecycle.hmrNgxsStoreBeforeOnDestroy();
|
|
656
529
|
};
|
|
657
|
-
|
|
658
|
-
* @return {?}
|
|
659
|
-
*/
|
|
660
|
-
HmrManager.prototype.createNewModule = /**
|
|
661
|
-
* @return {?}
|
|
662
|
-
*/
|
|
663
|
-
function () {
|
|
664
|
-
/** @type {?} */
|
|
530
|
+
HmrManager.prototype.createNewModule = function () {
|
|
665
531
|
var removeOldHosts = this.cloneHostsBeforeDestroy();
|
|
666
532
|
this.removeNgStyles();
|
|
667
533
|
this.ngModule.destroy();
|
|
668
534
|
removeOldHosts();
|
|
669
535
|
};
|
|
670
|
-
|
|
671
|
-
* @private
|
|
672
|
-
* @return {?}
|
|
673
|
-
*/
|
|
674
|
-
HmrManager.prototype.createLifecycle = /**
|
|
675
|
-
* @private
|
|
676
|
-
* @return {?}
|
|
677
|
-
*/
|
|
678
|
-
function () {
|
|
536
|
+
HmrManager.prototype.createLifecycle = function () {
|
|
679
537
|
return new HmrLifecycle(this.ngModule.instance, this.bootstrap, this.storage, this.context, this.optionsBuilder);
|
|
680
538
|
};
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
*/
|
|
685
|
-
HmrManager.prototype.cloneHostsBeforeDestroy = /**
|
|
686
|
-
* @private
|
|
687
|
-
* @return {?}
|
|
688
|
-
*/
|
|
689
|
-
function () {
|
|
690
|
-
/** @type {?} */
|
|
691
|
-
var elements = this.applicationRef.components.map((/**
|
|
692
|
-
* @param {?} component
|
|
693
|
-
* @return {?}
|
|
694
|
-
*/
|
|
695
|
-
function (component) { return component.location.nativeElement; }));
|
|
696
|
-
/** @type {?} */
|
|
697
|
-
var removableList = elements.map((/**
|
|
698
|
-
* @param {?} componentNode
|
|
699
|
-
* @return {?}
|
|
700
|
-
*/
|
|
701
|
-
function (componentNode) {
|
|
702
|
-
/** @type {?} */
|
|
539
|
+
HmrManager.prototype.cloneHostsBeforeDestroy = function () {
|
|
540
|
+
var elements = this.applicationRef.components.map(function (component) { return component.location.nativeElement; });
|
|
541
|
+
var removableList = elements.map(function (componentNode) {
|
|
703
542
|
var newNode = document.createElement(componentNode.tagName);
|
|
704
|
-
|
|
705
|
-
var parentNode = (/** @type {?} */ (componentNode.parentNode));
|
|
706
|
-
/** @type {?} */
|
|
543
|
+
var parentNode = componentNode.parentNode;
|
|
707
544
|
var currentDisplay = newNode.style.display;
|
|
708
545
|
newNode.style.display = 'none';
|
|
709
546
|
parentNode.insertBefore(newNode, componentNode);
|
|
710
|
-
return (
|
|
711
|
-
* @return {?}
|
|
712
|
-
*/
|
|
713
|
-
function () {
|
|
547
|
+
return function () {
|
|
714
548
|
newNode.style.display = currentDisplay;
|
|
715
549
|
try {
|
|
716
550
|
parentNode.removeChild(componentNode);
|
|
717
551
|
}
|
|
718
552
|
catch (_a) { }
|
|
719
|
-
}
|
|
720
|
-
}));
|
|
721
|
-
return (/**
|
|
722
|
-
* @return {?}
|
|
723
|
-
*/
|
|
724
|
-
function removeOldHosts() {
|
|
725
|
-
removableList.forEach((/**
|
|
726
|
-
* @param {?} removeOldHost
|
|
727
|
-
* @return {?}
|
|
728
|
-
*/
|
|
729
|
-
function (removeOldHost) { return removeOldHost(); }));
|
|
553
|
+
};
|
|
730
554
|
});
|
|
555
|
+
return function removeOldHosts() {
|
|
556
|
+
removableList.forEach(function (removeOldHost) { return removeOldHost(); });
|
|
557
|
+
};
|
|
731
558
|
};
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
*/
|
|
736
|
-
HmrManager.prototype.removeNgStyles = /**
|
|
737
|
-
* @private
|
|
738
|
-
* @return {?}
|
|
739
|
-
*/
|
|
740
|
-
function () {
|
|
741
|
-
/** @type {?} */
|
|
742
|
-
var head = (/** @type {?} */ (document.head));
|
|
743
|
-
/** @type {?} */
|
|
744
|
-
var styles = Array.from((/** @type {?} */ (head)).querySelectorAll('style'));
|
|
559
|
+
HmrManager.prototype.removeNgStyles = function () {
|
|
560
|
+
var head = document.head;
|
|
561
|
+
var styles = Array.from(head.querySelectorAll('style'));
|
|
745
562
|
styles
|
|
746
|
-
.filter((
|
|
747
|
-
|
|
748
|
-
* @return {?}
|
|
749
|
-
*/
|
|
750
|
-
function (style) { return style.innerText.includes('_ng'); }))
|
|
751
|
-
.map((/**
|
|
752
|
-
* @param {?} style
|
|
753
|
-
* @return {?}
|
|
754
|
-
*/
|
|
755
|
-
function (style) { return (/** @type {?} */ (head)).removeChild(style); }));
|
|
563
|
+
.filter(function (style) { return style.innerText.includes('_ng'); })
|
|
564
|
+
.map(function (style) { return head.removeChild(style); });
|
|
756
565
|
};
|
|
757
566
|
return HmrManager;
|
|
758
567
|
}());
|
|
759
|
-
if (false) {
|
|
760
|
-
/** @type {?} */
|
|
761
|
-
HmrManager.prototype.storage;
|
|
762
|
-
/** @type {?} */
|
|
763
|
-
HmrManager.prototype.context;
|
|
764
|
-
/** @type {?} */
|
|
765
|
-
HmrManager.prototype.lifecycle;
|
|
766
|
-
/** @type {?} */
|
|
767
|
-
HmrManager.prototype.optionsBuilder;
|
|
768
|
-
/**
|
|
769
|
-
* @type {?}
|
|
770
|
-
* @private
|
|
771
|
-
*/
|
|
772
|
-
HmrManager.prototype.ngModule;
|
|
773
|
-
}
|
|
774
568
|
|
|
775
|
-
/**
|
|
776
|
-
* @fileoverview added by tsickle
|
|
777
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
778
|
-
*/
|
|
779
|
-
/**
|
|
780
|
-
* @template S
|
|
781
|
-
*/
|
|
782
|
-
var /**
|
|
783
|
-
* @template S
|
|
784
|
-
*/
|
|
785
|
-
HmrStorage = /** @class */ (function () {
|
|
569
|
+
var HmrStorage = /** @class */ (function () {
|
|
786
570
|
function HmrStorage(_snapshot) {
|
|
787
571
|
if (_snapshot === void 0) { _snapshot = {}; }
|
|
788
572
|
this._snapshot = _snapshot;
|
|
789
573
|
}
|
|
790
|
-
|
|
791
|
-
* @return {?}
|
|
792
|
-
*/
|
|
793
|
-
HmrStorage.prototype.hasData = /**
|
|
794
|
-
* @return {?}
|
|
795
|
-
*/
|
|
796
|
-
function () {
|
|
574
|
+
HmrStorage.prototype.hasData = function () {
|
|
797
575
|
return Object.keys(this._snapshot).length > 0;
|
|
798
576
|
};
|
|
799
577
|
Object.defineProperty(HmrStorage.prototype, "snapshot", {
|
|
800
|
-
get:
|
|
801
|
-
* @return {?}
|
|
802
|
-
*/
|
|
803
|
-
function () {
|
|
578
|
+
get: function () {
|
|
804
579
|
return this._snapshot;
|
|
805
580
|
},
|
|
806
|
-
enumerable:
|
|
581
|
+
enumerable: false,
|
|
807
582
|
configurable: true
|
|
808
583
|
});
|
|
809
584
|
return HmrStorage;
|
|
810
585
|
}());
|
|
811
|
-
if (false) {
|
|
812
|
-
/**
|
|
813
|
-
* @type {?}
|
|
814
|
-
* @private
|
|
815
|
-
*/
|
|
816
|
-
HmrStorage.prototype._snapshot;
|
|
817
|
-
}
|
|
818
586
|
|
|
819
|
-
/**
|
|
820
|
-
* @fileoverview added by tsickle
|
|
821
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
822
|
-
*/
|
|
823
|
-
/**
|
|
824
|
-
* @param {?} value
|
|
825
|
-
* @return {?}
|
|
826
|
-
*/
|
|
827
587
|
function setHmrReloadedTo(value) {
|
|
828
588
|
if (window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */]) {
|
|
829
589
|
window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */].hmrReloaded = value;
|
|
830
590
|
}
|
|
831
591
|
}
|
|
832
|
-
/**
|
|
833
|
-
* @return {?}
|
|
834
|
-
*/
|
|
835
592
|
function markApplicationAsHmrReloaded() {
|
|
836
593
|
window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */] = window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */] || {
|
|
837
594
|
hmrReloaded: false
|
|
838
595
|
};
|
|
839
596
|
}
|
|
840
597
|
|
|
841
|
-
/**
|
|
842
|
-
* @fileoverview added by tsickle
|
|
843
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
844
|
-
*/
|
|
845
598
|
/**
|
|
846
599
|
* Hot Module Replacement plugin for NGXS
|
|
847
600
|
* @deprecated As of Angular v10, HMR is no longer supported and will be deprecated.
|
|
848
601
|
* More information [here](https://www.ngxs.io/plugins/hmr).
|
|
849
|
-
* @template T
|
|
850
|
-
* @param {?} webpackModule
|
|
851
|
-
* @param {?} bootstrapFn
|
|
852
|
-
* @param {?=} options
|
|
853
|
-
* @return {?}
|
|
854
602
|
*/
|
|
855
603
|
function hmr(webpackModule, bootstrapFn, options) {
|
|
856
604
|
if (options === void 0) { options = {}; }
|
|
857
605
|
return __awaiter(this, void 0, void 0, function () {
|
|
858
|
-
/**
|
|
859
|
-
* @record
|
|
860
|
-
*/
|
|
861
|
-
function HmrDataTransfer() { }
|
|
862
606
|
var dataTransfer, storage, manager;
|
|
863
607
|
return __generator(this, function (_a) {
|
|
864
608
|
switch (_a.label) {
|
|
@@ -869,44 +613,34 @@
|
|
|
869
613
|
}
|
|
870
614
|
markApplicationAsHmrReloaded();
|
|
871
615
|
webpackModule.hot.accept();
|
|
872
|
-
if (false) {
|
|
873
|
-
/** @type {?|undefined} */
|
|
874
|
-
HmrDataTransfer.prototype.snapshot;
|
|
875
|
-
}
|
|
876
616
|
dataTransfer = webpackModule.hot.data || {};
|
|
877
617
|
storage = new HmrStorage(dataTransfer.snapshot || {});
|
|
878
618
|
manager = new HmrManager(options, storage);
|
|
879
|
-
return [4 /*yield*/, manager.hmrModule(bootstrapFn, (
|
|
880
|
-
* @return {?}
|
|
881
|
-
*/
|
|
882
|
-
function () {
|
|
619
|
+
return [4 /*yield*/, manager.hmrModule(bootstrapFn, function () {
|
|
883
620
|
manager.beforeModuleBootstrap();
|
|
884
|
-
|
|
885
|
-
* @param {?} data
|
|
886
|
-
* @return {?}
|
|
887
|
-
*/
|
|
888
|
-
function (data) {
|
|
621
|
+
webpackModule.hot.dispose(function (data) {
|
|
889
622
|
setHmrReloadedTo(true);
|
|
890
623
|
data.snapshot = manager.beforeModuleOnDestroy();
|
|
891
624
|
manager.createNewModule();
|
|
892
|
-
})
|
|
893
|
-
})
|
|
625
|
+
});
|
|
626
|
+
})];
|
|
894
627
|
case 1: return [2 /*return*/, _a.sent()];
|
|
895
628
|
}
|
|
896
629
|
});
|
|
897
630
|
});
|
|
898
631
|
}
|
|
899
632
|
|
|
633
|
+
function hmrIsReloaded() {
|
|
634
|
+
return !!(window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */] && window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */].hmrReloaded);
|
|
635
|
+
}
|
|
636
|
+
|
|
900
637
|
/**
|
|
901
|
-
*
|
|
902
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
638
|
+
* The public api for consumers of @ngxs/hmr-plugin
|
|
903
639
|
*/
|
|
640
|
+
|
|
904
641
|
/**
|
|
905
|
-
*
|
|
642
|
+
* Generated bundle index. Do not edit.
|
|
906
643
|
*/
|
|
907
|
-
function hmrIsReloaded() {
|
|
908
|
-
return !!(window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */] && window["NGXS_HMR_LIFECYCLE_STATUS" /* Status */].hmrReloaded);
|
|
909
|
-
}
|
|
910
644
|
|
|
911
645
|
exports.HmrBeforeDestroyAction = HmrBeforeDestroyAction;
|
|
912
646
|
exports.HmrInitAction = HmrInitAction;
|