@ngxs/storage-plugin 3.8.2 → 18.0.0-dev.master-56d8014
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/esm2022/internals/index.mjs +3 -0
- package/esm2022/internals/ngxs-storage-plugin-internals.mjs +5 -0
- package/esm2022/internals/storage-key.mjs +20 -0
- package/esm2022/internals/symbols.mjs +16 -0
- package/{esm2015/src/engines.js → esm2022/src/engines.mjs} +2 -2
- package/esm2022/src/internals.mjs +31 -0
- package/esm2022/src/keys-manager.mjs +43 -0
- package/esm2022/src/public_api.mjs +6 -0
- package/esm2022/src/storage.module.mjs +61 -0
- package/esm2022/src/storage.plugin.mjs +146 -0
- package/esm2022/src/with-storage-feature.mjs +30 -0
- package/fesm2022/ngxs-storage-plugin-internals.mjs +43 -0
- package/fesm2022/ngxs-storage-plugin-internals.mjs.map +1 -0
- package/fesm2022/ngxs-storage-plugin.mjs +316 -0
- package/fesm2022/ngxs-storage-plugin.mjs.map +1 -0
- package/internals/index.d.ts +2 -0
- package/{src/internals → internals}/storage-key.d.ts +6 -6
- package/{src → internals}/symbols.d.ts +14 -4
- package/package.json +28 -14
- package/src/engines.d.ts +1 -1
- package/src/internals.d.ts +2 -7
- package/src/keys-manager.d.ts +18 -0
- package/src/public_api.d.ts +3 -2
- package/src/storage.module.d.ts +4 -4
- package/src/storage.plugin.d.ts +7 -5
- package/src/with-storage-feature.d.ts +3 -0
- package/bundles/ngxs-storage-plugin.umd.js +0 -794
- package/bundles/ngxs-storage-plugin.umd.js.map +0 -1
- package/esm2015/src/internals/final-options.js +0 -17
- package/esm2015/src/internals/storage-key.js +0 -21
- package/esm2015/src/internals.js +0 -27
- package/esm2015/src/public_api.js +0 -5
- package/esm2015/src/storage.module.js +0 -49
- package/esm2015/src/storage.plugin.js +0 -143
- package/esm2015/src/symbols.js +0 -5
- package/fesm2015/ngxs-storage-plugin.js +0 -268
- package/fesm2015/ngxs-storage-plugin.js.map +0 -1
- package/ngxs-storage-plugin.d.ts +0 -5
- package/src/internals/final-options.d.ts +0 -10
- /package/{esm2015/index.js → esm2022/index.mjs} +0 -0
- /package/{esm2015/ngxs-storage-plugin.js → esm2022/ngxs-storage-plugin.mjs} +0 -0
|
@@ -1,794 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store'), require('@angular/common'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@ngxs/storage-plugin', ['exports', '@angular/core', '@ngxs/store', '@angular/common', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs["storage-plugin"] = {}), global.ng.core, global["ngxs-store"], global.ng.common, global.rxjs.operators));
|
|
5
|
-
})(this, (function (exports, i0, store, common, operators) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
|
|
27
|
-
var NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
28
|
-
var NGXS_STORAGE_PLUGIN_OPTIONS = new i0.InjectionToken(NG_DEV_MODE$4 ? 'NGXS_STORAGE_PLUGIN_OPTIONS' : '');
|
|
29
|
-
var STORAGE_ENGINE = new i0.InjectionToken(NG_DEV_MODE$4 ? 'STORAGE_ENGINE' : '');
|
|
30
|
-
|
|
31
|
-
/******************************************************************************
|
|
32
|
-
Copyright (c) Microsoft Corporation.
|
|
33
|
-
|
|
34
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
35
|
-
purpose with or without fee is hereby granted.
|
|
36
|
-
|
|
37
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
38
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
39
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
40
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
41
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
42
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
43
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
44
|
-
***************************************************************************** */
|
|
45
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
46
|
-
var extendStatics = function (d, b) {
|
|
47
|
-
extendStatics = Object.setPrototypeOf ||
|
|
48
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
49
|
-
function (d, b) { for (var p in b)
|
|
50
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
51
|
-
d[p] = b[p]; };
|
|
52
|
-
return extendStatics(d, b);
|
|
53
|
-
};
|
|
54
|
-
function __extends(d, b) {
|
|
55
|
-
if (typeof b !== "function" && b !== null)
|
|
56
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
57
|
-
extendStatics(d, b);
|
|
58
|
-
function __() { this.constructor = d; }
|
|
59
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
60
|
-
}
|
|
61
|
-
var __assign = function () {
|
|
62
|
-
__assign = Object.assign || function __assign(t) {
|
|
63
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
64
|
-
s = arguments[i];
|
|
65
|
-
for (var p in s)
|
|
66
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
67
|
-
t[p] = s[p];
|
|
68
|
-
}
|
|
69
|
-
return t;
|
|
70
|
-
};
|
|
71
|
-
return __assign.apply(this, arguments);
|
|
72
|
-
};
|
|
73
|
-
function __rest(s, e) {
|
|
74
|
-
var t = {};
|
|
75
|
-
for (var p in s)
|
|
76
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
77
|
-
t[p] = s[p];
|
|
78
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
79
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
80
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
81
|
-
t[p[i]] = s[p[i]];
|
|
82
|
-
}
|
|
83
|
-
return t;
|
|
84
|
-
}
|
|
85
|
-
function __decorate(decorators, target, key, desc) {
|
|
86
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
87
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
88
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
89
|
-
else
|
|
90
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
91
|
-
if (d = decorators[i])
|
|
92
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
93
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
94
|
-
}
|
|
95
|
-
function __param(paramIndex, decorator) {
|
|
96
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
97
|
-
}
|
|
98
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
99
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
100
|
-
throw new TypeError("Function expected"); return f; }
|
|
101
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
102
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
103
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
104
|
-
var _, done = false;
|
|
105
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
106
|
-
var context = {};
|
|
107
|
-
for (var p in contextIn)
|
|
108
|
-
context[p] = p === "access" ? {} : contextIn[p];
|
|
109
|
-
for (var p in contextIn.access)
|
|
110
|
-
context.access[p] = contextIn.access[p];
|
|
111
|
-
context.addInitializer = function (f) { if (done)
|
|
112
|
-
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
113
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
114
|
-
if (kind === "accessor") {
|
|
115
|
-
if (result === void 0)
|
|
116
|
-
continue;
|
|
117
|
-
if (result === null || typeof result !== "object")
|
|
118
|
-
throw new TypeError("Object expected");
|
|
119
|
-
if (_ = accept(result.get))
|
|
120
|
-
descriptor.get = _;
|
|
121
|
-
if (_ = accept(result.set))
|
|
122
|
-
descriptor.set = _;
|
|
123
|
-
if (_ = accept(result.init))
|
|
124
|
-
initializers.unshift(_);
|
|
125
|
-
}
|
|
126
|
-
else if (_ = accept(result)) {
|
|
127
|
-
if (kind === "field")
|
|
128
|
-
initializers.unshift(_);
|
|
129
|
-
else
|
|
130
|
-
descriptor[key] = _;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (target)
|
|
134
|
-
Object.defineProperty(target, contextIn.name, descriptor);
|
|
135
|
-
done = true;
|
|
136
|
-
}
|
|
137
|
-
;
|
|
138
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
139
|
-
var useValue = arguments.length > 2;
|
|
140
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
141
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
142
|
-
}
|
|
143
|
-
return useValue ? value : void 0;
|
|
144
|
-
}
|
|
145
|
-
;
|
|
146
|
-
function __propKey(x) {
|
|
147
|
-
return typeof x === "symbol" ? x : "".concat(x);
|
|
148
|
-
}
|
|
149
|
-
;
|
|
150
|
-
function __setFunctionName(f, name, prefix) {
|
|
151
|
-
if (typeof name === "symbol")
|
|
152
|
-
name = name.description ? "[".concat(name.description, "]") : "";
|
|
153
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
154
|
-
}
|
|
155
|
-
;
|
|
156
|
-
function __metadata(metadataKey, metadataValue) {
|
|
157
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
158
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
159
|
-
}
|
|
160
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
161
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
162
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
163
|
-
function fulfilled(value) { try {
|
|
164
|
-
step(generator.next(value));
|
|
165
|
-
}
|
|
166
|
-
catch (e) {
|
|
167
|
-
reject(e);
|
|
168
|
-
} }
|
|
169
|
-
function rejected(value) { try {
|
|
170
|
-
step(generator["throw"](value));
|
|
171
|
-
}
|
|
172
|
-
catch (e) {
|
|
173
|
-
reject(e);
|
|
174
|
-
} }
|
|
175
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
176
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function __generator(thisArg, body) {
|
|
180
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
181
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
182
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
183
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
184
|
-
function step(op) {
|
|
185
|
-
if (f)
|
|
186
|
-
throw new TypeError("Generator is already executing.");
|
|
187
|
-
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
188
|
-
try {
|
|
189
|
-
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)
|
|
190
|
-
return t;
|
|
191
|
-
if (y = 0, t)
|
|
192
|
-
op = [op[0] & 2, t.value];
|
|
193
|
-
switch (op[0]) {
|
|
194
|
-
case 0:
|
|
195
|
-
case 1:
|
|
196
|
-
t = op;
|
|
197
|
-
break;
|
|
198
|
-
case 4:
|
|
199
|
-
_.label++;
|
|
200
|
-
return { value: op[1], done: false };
|
|
201
|
-
case 5:
|
|
202
|
-
_.label++;
|
|
203
|
-
y = op[1];
|
|
204
|
-
op = [0];
|
|
205
|
-
continue;
|
|
206
|
-
case 7:
|
|
207
|
-
op = _.ops.pop();
|
|
208
|
-
_.trys.pop();
|
|
209
|
-
continue;
|
|
210
|
-
default:
|
|
211
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
212
|
-
_ = 0;
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
216
|
-
_.label = op[1];
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
220
|
-
_.label = t[1];
|
|
221
|
-
t = op;
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
if (t && _.label < t[2]) {
|
|
225
|
-
_.label = t[2];
|
|
226
|
-
_.ops.push(op);
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
if (t[2])
|
|
230
|
-
_.ops.pop();
|
|
231
|
-
_.trys.pop();
|
|
232
|
-
continue;
|
|
233
|
-
}
|
|
234
|
-
op = body.call(thisArg, _);
|
|
235
|
-
}
|
|
236
|
-
catch (e) {
|
|
237
|
-
op = [6, e];
|
|
238
|
-
y = 0;
|
|
239
|
-
}
|
|
240
|
-
finally {
|
|
241
|
-
f = t = 0;
|
|
242
|
-
}
|
|
243
|
-
if (op[0] & 5)
|
|
244
|
-
throw op[1];
|
|
245
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
249
|
-
if (k2 === undefined)
|
|
250
|
-
k2 = k;
|
|
251
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
252
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
253
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
254
|
-
}
|
|
255
|
-
Object.defineProperty(o, k2, desc);
|
|
256
|
-
}) : (function (o, m, k, k2) {
|
|
257
|
-
if (k2 === undefined)
|
|
258
|
-
k2 = k;
|
|
259
|
-
o[k2] = m[k];
|
|
260
|
-
});
|
|
261
|
-
function __exportStar(m, o) {
|
|
262
|
-
for (var p in m)
|
|
263
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
264
|
-
__createBinding(o, m, p);
|
|
265
|
-
}
|
|
266
|
-
function __values(o) {
|
|
267
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
268
|
-
if (m)
|
|
269
|
-
return m.call(o);
|
|
270
|
-
if (o && typeof o.length === "number")
|
|
271
|
-
return {
|
|
272
|
-
next: function () {
|
|
273
|
-
if (o && i >= o.length)
|
|
274
|
-
o = void 0;
|
|
275
|
-
return { value: o && o[i++], done: !o };
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
279
|
-
}
|
|
280
|
-
function __read(o, n) {
|
|
281
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
282
|
-
if (!m)
|
|
283
|
-
return o;
|
|
284
|
-
var i = m.call(o), r, ar = [], e;
|
|
285
|
-
try {
|
|
286
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
287
|
-
ar.push(r.value);
|
|
288
|
-
}
|
|
289
|
-
catch (error) {
|
|
290
|
-
e = { error: error };
|
|
291
|
-
}
|
|
292
|
-
finally {
|
|
293
|
-
try {
|
|
294
|
-
if (r && !r.done && (m = i["return"]))
|
|
295
|
-
m.call(i);
|
|
296
|
-
}
|
|
297
|
-
finally {
|
|
298
|
-
if (e)
|
|
299
|
-
throw e.error;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return ar;
|
|
303
|
-
}
|
|
304
|
-
/** @deprecated */
|
|
305
|
-
function __spread() {
|
|
306
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
307
|
-
ar = ar.concat(__read(arguments[i]));
|
|
308
|
-
return ar;
|
|
309
|
-
}
|
|
310
|
-
/** @deprecated */
|
|
311
|
-
function __spreadArrays() {
|
|
312
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
313
|
-
s += arguments[i].length;
|
|
314
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
315
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
316
|
-
r[k] = a[j];
|
|
317
|
-
return r;
|
|
318
|
-
}
|
|
319
|
-
function __spreadArray(to, from, pack) {
|
|
320
|
-
if (pack || arguments.length === 2)
|
|
321
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
322
|
-
if (ar || !(i in from)) {
|
|
323
|
-
if (!ar)
|
|
324
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
325
|
-
ar[i] = from[i];
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
329
|
-
}
|
|
330
|
-
function __await(v) {
|
|
331
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
332
|
-
}
|
|
333
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
334
|
-
if (!Symbol.asyncIterator)
|
|
335
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
336
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
337
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
338
|
-
function verb(n) { if (g[n])
|
|
339
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
340
|
-
function resume(n, v) { try {
|
|
341
|
-
step(g[n](v));
|
|
342
|
-
}
|
|
343
|
-
catch (e) {
|
|
344
|
-
settle(q[0][3], e);
|
|
345
|
-
} }
|
|
346
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
347
|
-
function fulfill(value) { resume("next", value); }
|
|
348
|
-
function reject(value) { resume("throw", value); }
|
|
349
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
350
|
-
resume(q[0][0], q[0][1]); }
|
|
351
|
-
}
|
|
352
|
-
function __asyncDelegator(o) {
|
|
353
|
-
var i, p;
|
|
354
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
355
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
356
|
-
}
|
|
357
|
-
function __asyncValues(o) {
|
|
358
|
-
if (!Symbol.asyncIterator)
|
|
359
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
360
|
-
var m = o[Symbol.asyncIterator], i;
|
|
361
|
-
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);
|
|
362
|
-
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); }); }; }
|
|
363
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
364
|
-
}
|
|
365
|
-
function __makeTemplateObject(cooked, raw) {
|
|
366
|
-
if (Object.defineProperty) {
|
|
367
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
cooked.raw = raw;
|
|
371
|
-
}
|
|
372
|
-
return cooked;
|
|
373
|
-
}
|
|
374
|
-
;
|
|
375
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
376
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
377
|
-
}) : function (o, v) {
|
|
378
|
-
o["default"] = v;
|
|
379
|
-
};
|
|
380
|
-
function __importStar(mod) {
|
|
381
|
-
if (mod && mod.__esModule)
|
|
382
|
-
return mod;
|
|
383
|
-
var result = {};
|
|
384
|
-
if (mod != null)
|
|
385
|
-
for (var k in mod)
|
|
386
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
387
|
-
__createBinding(result, mod, k);
|
|
388
|
-
__setModuleDefault(result, mod);
|
|
389
|
-
return result;
|
|
390
|
-
}
|
|
391
|
-
function __importDefault(mod) {
|
|
392
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
393
|
-
}
|
|
394
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
395
|
-
if (kind === "a" && !f)
|
|
396
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
397
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
398
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
399
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
400
|
-
}
|
|
401
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
402
|
-
if (kind === "m")
|
|
403
|
-
throw new TypeError("Private method is not writable");
|
|
404
|
-
if (kind === "a" && !f)
|
|
405
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
406
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
407
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
408
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
409
|
-
}
|
|
410
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
411
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
412
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
413
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
414
|
-
}
|
|
415
|
-
function __addDisposableResource(env, value, async) {
|
|
416
|
-
if (value !== null && value !== void 0) {
|
|
417
|
-
if (typeof value !== "object" && typeof value !== "function")
|
|
418
|
-
throw new TypeError("Object expected.");
|
|
419
|
-
var dispose;
|
|
420
|
-
if (async) {
|
|
421
|
-
if (!Symbol.asyncDispose)
|
|
422
|
-
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
423
|
-
dispose = value[Symbol.asyncDispose];
|
|
424
|
-
}
|
|
425
|
-
if (dispose === void 0) {
|
|
426
|
-
if (!Symbol.dispose)
|
|
427
|
-
throw new TypeError("Symbol.dispose is not defined.");
|
|
428
|
-
dispose = value[Symbol.dispose];
|
|
429
|
-
}
|
|
430
|
-
if (typeof dispose !== "function")
|
|
431
|
-
throw new TypeError("Object not disposable.");
|
|
432
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
433
|
-
}
|
|
434
|
-
else if (async) {
|
|
435
|
-
env.stack.push({ async: true });
|
|
436
|
-
}
|
|
437
|
-
return value;
|
|
438
|
-
}
|
|
439
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
440
|
-
var e = new Error(message);
|
|
441
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
442
|
-
};
|
|
443
|
-
function __disposeResources(env) {
|
|
444
|
-
function fail(e) {
|
|
445
|
-
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
446
|
-
env.hasError = true;
|
|
447
|
-
}
|
|
448
|
-
function next() {
|
|
449
|
-
while (env.stack.length) {
|
|
450
|
-
var rec = env.stack.pop();
|
|
451
|
-
try {
|
|
452
|
-
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
453
|
-
if (rec.async)
|
|
454
|
-
return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
|
|
455
|
-
}
|
|
456
|
-
catch (e) {
|
|
457
|
-
fail(e);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
if (env.hasError)
|
|
461
|
-
throw env.error;
|
|
462
|
-
}
|
|
463
|
-
return next();
|
|
464
|
-
}
|
|
465
|
-
var tslib_es6 = {
|
|
466
|
-
__extends: __extends,
|
|
467
|
-
__assign: __assign,
|
|
468
|
-
__rest: __rest,
|
|
469
|
-
__decorate: __decorate,
|
|
470
|
-
__param: __param,
|
|
471
|
-
__metadata: __metadata,
|
|
472
|
-
__awaiter: __awaiter,
|
|
473
|
-
__generator: __generator,
|
|
474
|
-
__createBinding: __createBinding,
|
|
475
|
-
__exportStar: __exportStar,
|
|
476
|
-
__values: __values,
|
|
477
|
-
__read: __read,
|
|
478
|
-
__spread: __spread,
|
|
479
|
-
__spreadArrays: __spreadArrays,
|
|
480
|
-
__spreadArray: __spreadArray,
|
|
481
|
-
__await: __await,
|
|
482
|
-
__asyncGenerator: __asyncGenerator,
|
|
483
|
-
__asyncDelegator: __asyncDelegator,
|
|
484
|
-
__asyncValues: __asyncValues,
|
|
485
|
-
__makeTemplateObject: __makeTemplateObject,
|
|
486
|
-
__importStar: __importStar,
|
|
487
|
-
__importDefault: __importDefault,
|
|
488
|
-
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
489
|
-
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
490
|
-
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
491
|
-
__addDisposableResource: __addDisposableResource,
|
|
492
|
-
__disposeResources: __disposeResources,
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* The following key is used to store the entire serialized
|
|
497
|
-
* state when there's no specific state provided.
|
|
498
|
-
*/
|
|
499
|
-
var DEFAULT_STATE_KEY = '@@STATE';
|
|
500
|
-
function storageOptionsFactory(options) {
|
|
501
|
-
return Object.assign({ key: [DEFAULT_STATE_KEY], storage: 0 /* LocalStorage */, serialize: JSON.stringify, deserialize: JSON.parse, beforeSerialize: function (obj) { return obj; }, afterDeserialize: function (obj) { return obj; } }, options);
|
|
502
|
-
}
|
|
503
|
-
function engineFactory(options, platformId) {
|
|
504
|
-
if (common.isPlatformServer(platformId)) {
|
|
505
|
-
return null;
|
|
506
|
-
}
|
|
507
|
-
if (options.storage === 0 /* LocalStorage */) {
|
|
508
|
-
return localStorage;
|
|
509
|
-
}
|
|
510
|
-
else if (options.storage === 1 /* SessionStorage */) {
|
|
511
|
-
return sessionStorage;
|
|
512
|
-
}
|
|
513
|
-
return null;
|
|
514
|
-
}
|
|
515
|
-
function getStorageKey(key, options) {
|
|
516
|
-
// Prepends the `namespace` option to any key if it's been provided by a user.
|
|
517
|
-
// So `@@STATE` becomes `my-app:@@STATE`.
|
|
518
|
-
return options && options.namespace ? options.namespace + ":" + key : key;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/** Determines whether the provided key has the following structure. */
|
|
522
|
-
function isKeyWithExplicitEngine(key) {
|
|
523
|
-
return key != null && !!key.engine;
|
|
524
|
-
}
|
|
525
|
-
/** This symbol is used to store the metadata on state classes. */
|
|
526
|
-
var META_OPTIONS_KEY = 'NGXS_OPTIONS_META';
|
|
527
|
-
function exctractStringKey(storageKey) {
|
|
528
|
-
// Extract the actual key out of the `{ key, engine }` structure.
|
|
529
|
-
if (isKeyWithExplicitEngine(storageKey)) {
|
|
530
|
-
storageKey = storageKey.key;
|
|
531
|
-
}
|
|
532
|
-
// Given the `storageKey` is a class, for instance, `AuthState`.
|
|
533
|
-
// We should retrieve its metadata and the `name` property.
|
|
534
|
-
// The `name` property might be a string (state name) or a state token.
|
|
535
|
-
if (storageKey.hasOwnProperty(META_OPTIONS_KEY)) {
|
|
536
|
-
storageKey = storageKey[META_OPTIONS_KEY].name;
|
|
537
|
-
}
|
|
538
|
-
return storageKey instanceof store.StateToken ? storageKey.getName() : storageKey;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
var NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
542
|
-
var FINAL_NGXS_STORAGE_PLUGIN_OPTIONS = new i0.InjectionToken(NG_DEV_MODE$3 ? 'FINAL_NGXS_STORAGE_PLUGIN_OPTIONS' : '');
|
|
543
|
-
function createFinalStoragePluginOptions(injector, options) {
|
|
544
|
-
var storageKeys = Array.isArray(options.key) ? options.key : [options.key];
|
|
545
|
-
var keysWithEngines = storageKeys.map(function (storageKey) {
|
|
546
|
-
var key = exctractStringKey(storageKey);
|
|
547
|
-
var engine = isKeyWithExplicitEngine(storageKey)
|
|
548
|
-
? injector.get(storageKey.engine)
|
|
549
|
-
: injector.get(STORAGE_ENGINE);
|
|
550
|
-
return { key: key, engine: engine };
|
|
551
|
-
});
|
|
552
|
-
return Object.assign(Object.assign({}, options), { keysWithEngines: keysWithEngines });
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
var NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
556
|
-
var NgxsStoragePlugin = /** @class */ (function () {
|
|
557
|
-
function NgxsStoragePlugin(_options, _platformId) {
|
|
558
|
-
this._options = _options;
|
|
559
|
-
this._platformId = _platformId;
|
|
560
|
-
this._keysWithEngines = this._options.keysWithEngines;
|
|
561
|
-
// We default to `[DEFAULT_STATE_KEY]` if the user explicitly does not provide the `key` option.
|
|
562
|
-
this._usesDefaultStateKey = this._keysWithEngines.length === 1 && this._keysWithEngines[0].key === DEFAULT_STATE_KEY;
|
|
563
|
-
}
|
|
564
|
-
NgxsStoragePlugin.prototype.handle = function (state, event, next) {
|
|
565
|
-
var e_1, _c;
|
|
566
|
-
var _this = this;
|
|
567
|
-
var _a;
|
|
568
|
-
if (common.isPlatformServer(this._platformId)) {
|
|
569
|
-
return next(state, event);
|
|
570
|
-
}
|
|
571
|
-
var matches = store.actionMatcher(event);
|
|
572
|
-
var isInitAction = matches(store.InitState);
|
|
573
|
-
var isUpdateAction = matches(store.UpdateState);
|
|
574
|
-
var isInitOrUpdateAction = isInitAction || isUpdateAction;
|
|
575
|
-
var hasMigration = false;
|
|
576
|
-
if (isInitOrUpdateAction) {
|
|
577
|
-
var addedStates = isUpdateAction && event.addedStates;
|
|
578
|
-
var _loop_1 = function (key, engine) {
|
|
579
|
-
// We're checking what states have been added by NGXS and if any of these states should be handled by
|
|
580
|
-
// the storage plugin. For instance, we only want to deserialize the `auth` state, NGXS has added
|
|
581
|
-
// the `user` state, the storage plugin will be rerun and will do redundant deserialization.
|
|
582
|
-
// `usesDefaultStateKey` is necessary to check since `event.addedStates` never contains `@@STATE`.
|
|
583
|
-
if (!this_1._usesDefaultStateKey && addedStates) {
|
|
584
|
-
// We support providing keys that can be deeply nested via dot notation, for instance,
|
|
585
|
-
// `keys: ['myState.myProperty']` is a valid key.
|
|
586
|
-
// The state name should always go first. The below code checks if the `key` includes dot
|
|
587
|
-
// notation and extracts the state name out of the key.
|
|
588
|
-
// Given the `key` is `myState.myProperty`, the `addedStates` will only contain `myState`.
|
|
589
|
-
var dotNotationIndex = key.indexOf(DOT);
|
|
590
|
-
var stateName = dotNotationIndex > -1 ? key.slice(0, dotNotationIndex) : key;
|
|
591
|
-
if (!addedStates.hasOwnProperty(stateName)) {
|
|
592
|
-
return "continue";
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
var storageKey = getStorageKey(key, this_1._options);
|
|
596
|
-
var storedValue = engine.getItem(storageKey);
|
|
597
|
-
if (storedValue !== 'undefined' && storedValue != null) {
|
|
598
|
-
try {
|
|
599
|
-
var newVal = this_1._options.deserialize(storedValue);
|
|
600
|
-
storedValue = this_1._options.afterDeserialize(newVal, key);
|
|
601
|
-
}
|
|
602
|
-
catch (_b) {
|
|
603
|
-
if (NG_DEV_MODE$2) {
|
|
604
|
-
console.error("Error ocurred while deserializing the " + storageKey + " store value, falling back to empty object, the value obtained from the store: ", storedValue);
|
|
605
|
-
}
|
|
606
|
-
storedValue = {};
|
|
607
|
-
}
|
|
608
|
-
(_a = this_1._options.migrations) === null || _a === void 0 ? void 0 : _a.forEach(function (strategy) {
|
|
609
|
-
var versionMatch = strategy.version === store.getValue(storedValue, strategy.versionKey || 'version');
|
|
610
|
-
var keyMatch = (!strategy.key && _this._usesDefaultStateKey) || strategy.key === key;
|
|
611
|
-
if (versionMatch && keyMatch) {
|
|
612
|
-
storedValue = strategy.migrate(storedValue);
|
|
613
|
-
hasMigration = true;
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
if (!this_1._usesDefaultStateKey) {
|
|
617
|
-
state = store.setValue(state, key, storedValue);
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
// The `UpdateState` action is dispatched whenever the feature
|
|
621
|
-
// state is added. The condition below is satisfied only when
|
|
622
|
-
// the `UpdateState` action is dispatched. Let's consider two states:
|
|
623
|
-
// `counter` and `@ngxs/router-plugin` state. When we call `NgxsModule.forRoot()`,
|
|
624
|
-
// `CounterState` is provided at the root level, while `@ngxs/router-plugin`
|
|
625
|
-
// is provided as a feature state. Beforehand, the storage plugin may have
|
|
626
|
-
// stored the value of the counter state as `10`. If `CounterState` implements
|
|
627
|
-
// the `ngxsOnInit` hook and calls `ctx.setState(999)`, the storage plugin
|
|
628
|
-
// will rehydrate the entire state when the `RouterState` is registered.
|
|
629
|
-
// Consequently, the `counter` state will revert back to `10` instead of `999`.
|
|
630
|
-
if (storedValue && addedStates && Object.keys(addedStates).length > 0) {
|
|
631
|
-
storedValue = Object.keys(addedStates).reduce(function (accumulator, addedState) {
|
|
632
|
-
// The `storedValue` can be equal to the entire state when the default
|
|
633
|
-
// state key is used. However, if `addedStates` only contains the `router` value,
|
|
634
|
-
// we only want to merge the state with the `router` value.
|
|
635
|
-
// Let's assume that the `storedValue` is an object:
|
|
636
|
-
// `{ counter: 10, router: {...} }`
|
|
637
|
-
// This will pick only the `router` object from the `storedValue` and `counter`
|
|
638
|
-
// state will not be rehydrated unnecessary.
|
|
639
|
-
if (storedValue.hasOwnProperty(addedState)) {
|
|
640
|
-
accumulator[addedState] = storedValue[addedState];
|
|
641
|
-
}
|
|
642
|
-
return accumulator;
|
|
643
|
-
}, {});
|
|
644
|
-
}
|
|
645
|
-
state = Object.assign(Object.assign({}, state), storedValue);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
var this_1 = this;
|
|
650
|
-
try {
|
|
651
|
-
for (var _d = __values(this._keysWithEngines), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
652
|
-
var _f = _e.value, key = _f.key, engine = _f.engine;
|
|
653
|
-
_loop_1(key, engine);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
657
|
-
finally {
|
|
658
|
-
try {
|
|
659
|
-
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
660
|
-
}
|
|
661
|
-
finally { if (e_1) throw e_1.error; }
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
return next(state, event).pipe(operators.tap(function (nextState) {
|
|
665
|
-
var e_2, _c;
|
|
666
|
-
if (isInitOrUpdateAction && !hasMigration) {
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
try {
|
|
670
|
-
for (var _d = __values(_this._keysWithEngines), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
671
|
-
var _f = _e.value, key = _f.key, engine = _f.engine;
|
|
672
|
-
var storedValue = nextState;
|
|
673
|
-
var storageKey = getStorageKey(key, _this._options);
|
|
674
|
-
if (key !== DEFAULT_STATE_KEY) {
|
|
675
|
-
storedValue = store.getValue(nextState, key);
|
|
676
|
-
}
|
|
677
|
-
try {
|
|
678
|
-
var newStoredValue = _this._options.beforeSerialize(storedValue, key);
|
|
679
|
-
engine.setItem(storageKey, _this._options.serialize(newStoredValue));
|
|
680
|
-
}
|
|
681
|
-
catch (error) {
|
|
682
|
-
if (NG_DEV_MODE$2) {
|
|
683
|
-
if (error &&
|
|
684
|
-
(error.name === 'QuotaExceededError' ||
|
|
685
|
-
error.name === 'NS_ERROR_DOM_QUOTA_REACHED')) {
|
|
686
|
-
console.error("The " + storageKey + " store value exceeds the browser storage quota: ", storedValue);
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
console.error("Error ocurred while serializing the " + storageKey + " store value, value not updated, the value obtained from the store: ", storedValue);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
696
|
-
finally {
|
|
697
|
-
try {
|
|
698
|
-
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
699
|
-
}
|
|
700
|
-
finally { if (e_2) throw e_2.error; }
|
|
701
|
-
}
|
|
702
|
-
}));
|
|
703
|
-
};
|
|
704
|
-
return NgxsStoragePlugin;
|
|
705
|
-
}());
|
|
706
|
-
/** @nocollapse */ NgxsStoragePlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePlugin, deps: [{ token: FINAL_NGXS_STORAGE_PLUGIN_OPTIONS }, { token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
707
|
-
/** @nocollapse */ NgxsStoragePlugin.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePlugin });
|
|
708
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePlugin, decorators: [{
|
|
709
|
-
type: i0.Injectable
|
|
710
|
-
}], ctorParameters: function () {
|
|
711
|
-
return [{ type: undefined, decorators: [{
|
|
712
|
-
type: i0.Inject,
|
|
713
|
-
args: [FINAL_NGXS_STORAGE_PLUGIN_OPTIONS]
|
|
714
|
-
}] }, { type: undefined, decorators: [{
|
|
715
|
-
type: i0.Inject,
|
|
716
|
-
args: [i0.PLATFORM_ID]
|
|
717
|
-
}] }];
|
|
718
|
-
} });
|
|
719
|
-
var DOT = '.';
|
|
720
|
-
|
|
721
|
-
var NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
722
|
-
var USER_OPTIONS = new i0.InjectionToken(NG_DEV_MODE$1 ? 'USER_OPTIONS' : '');
|
|
723
|
-
var NgxsStoragePluginModule = /** @class */ (function () {
|
|
724
|
-
function NgxsStoragePluginModule() {
|
|
725
|
-
}
|
|
726
|
-
NgxsStoragePluginModule.forRoot = function (options) {
|
|
727
|
-
return {
|
|
728
|
-
ngModule: NgxsStoragePluginModule,
|
|
729
|
-
providers: [
|
|
730
|
-
{
|
|
731
|
-
provide: store.NGXS_PLUGINS,
|
|
732
|
-
useClass: NgxsStoragePlugin,
|
|
733
|
-
multi: true
|
|
734
|
-
},
|
|
735
|
-
{
|
|
736
|
-
provide: USER_OPTIONS,
|
|
737
|
-
useValue: options
|
|
738
|
-
},
|
|
739
|
-
{
|
|
740
|
-
provide: NGXS_STORAGE_PLUGIN_OPTIONS,
|
|
741
|
-
useFactory: storageOptionsFactory,
|
|
742
|
-
deps: [USER_OPTIONS]
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
provide: STORAGE_ENGINE,
|
|
746
|
-
useFactory: engineFactory,
|
|
747
|
-
deps: [NGXS_STORAGE_PLUGIN_OPTIONS, i0.PLATFORM_ID]
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
provide: FINAL_NGXS_STORAGE_PLUGIN_OPTIONS,
|
|
751
|
-
useFactory: createFinalStoragePluginOptions,
|
|
752
|
-
deps: [i0.Injector, NGXS_STORAGE_PLUGIN_OPTIONS]
|
|
753
|
-
}
|
|
754
|
-
]
|
|
755
|
-
};
|
|
756
|
-
};
|
|
757
|
-
return NgxsStoragePluginModule;
|
|
758
|
-
}());
|
|
759
|
-
/** @nocollapse */ NgxsStoragePluginModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePluginModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
760
|
-
/** @nocollapse */ NgxsStoragePluginModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePluginModule });
|
|
761
|
-
/** @nocollapse */ NgxsStoragePluginModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePluginModule });
|
|
762
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxsStoragePluginModule, decorators: [{
|
|
763
|
-
type: i0.NgModule
|
|
764
|
-
}] });
|
|
765
|
-
|
|
766
|
-
var NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
767
|
-
var LOCAL_STORAGE_ENGINE = new i0.InjectionToken(NG_DEV_MODE ? 'LOCAL_STORAGE_ENGINE' : '', {
|
|
768
|
-
providedIn: 'root',
|
|
769
|
-
factory: function () { return (common.isPlatformBrowser(i0.inject(i0.PLATFORM_ID)) ? localStorage : null); }
|
|
770
|
-
});
|
|
771
|
-
var SESSION_STORAGE_ENGINE = new i0.InjectionToken(NG_DEV_MODE ? 'SESSION_STORAGE_ENGINE' : '', {
|
|
772
|
-
providedIn: 'root',
|
|
773
|
-
factory: function () { return (common.isPlatformBrowser(i0.inject(i0.PLATFORM_ID)) ? sessionStorage : null); }
|
|
774
|
-
});
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* The public api for consumers of @ngxs/storage-plugin
|
|
778
|
-
*/
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* Generated bundle index. Do not edit.
|
|
782
|
-
*/
|
|
783
|
-
|
|
784
|
-
exports.LOCAL_STORAGE_ENGINE = LOCAL_STORAGE_ENGINE;
|
|
785
|
-
exports.NGXS_STORAGE_PLUGIN_OPTIONS = NGXS_STORAGE_PLUGIN_OPTIONS;
|
|
786
|
-
exports.NgxsStoragePlugin = NgxsStoragePlugin;
|
|
787
|
-
exports.NgxsStoragePluginModule = NgxsStoragePluginModule;
|
|
788
|
-
exports.SESSION_STORAGE_ENGINE = SESSION_STORAGE_ENGINE;
|
|
789
|
-
exports.STORAGE_ENGINE = STORAGE_ENGINE;
|
|
790
|
-
|
|
791
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
792
|
-
|
|
793
|
-
}));
|
|
794
|
-
//# sourceMappingURL=ngxs-storage-plugin.umd.js.map
|