redux-astroglide 0.1.20 → 0.1.21
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/dist/index.es.js +101 -139
- package/dist/index.js +101 -139
- package/dist/index.umd.js +3058 -329
- package/dist/plugins/index.es.js +58 -84
- package/dist/plugins/index.js +58 -84
- package/dist/plugins/index.umd.js +58 -84
- package/dist/plugins/persist/index.es.js +3 -1
- package/dist/plugins/persist/index.js +3 -1
- package/dist/plugins/persist/index.umd.js +3 -1
- package/dist/plugins/type/index.es.js +18 -24
- package/dist/plugins/type/index.js +18 -24
- package/dist/plugins/type/index.umd.js +18 -24
- package/dist/selectors/index.es.js +58 -72
- package/dist/selectors/index.js +58 -72
- package/dist/selectors/index.umd.js +2841 -80
- package/dist/types/astroglide.d.ts +1 -1
- package/dist/types/plugins/persist/__tests__/persist.test.d.ts +1 -0
- package/dist/types/setupTests.d.ts +2 -0
- package/package.json +14 -2
- package/CHANGELOG.md +0 -4
- package/plugins/index.es.js +0 -325
- package/plugins/index.js +0 -338
- package/plugins/index.umd.js +0 -422
- package/plugins/persist/index.es.js +0 -69
- package/plugins/persist/index.js +0 -76
- package/plugins/persist/index.umd.js +0 -82
- package/plugins/set/index.es.js +0 -17
- package/plugins/set/index.js +0 -19
- package/plugins/set/index.umd.js +0 -25
- package/plugins/type/index.es.js +0 -104
- package/plugins/type/index.js +0 -110
- package/plugins/type/index.umd.js +0 -194
package/dist/plugins/index.es.js
CHANGED
|
@@ -16,6 +16,46 @@ var index$2 = (function (callback) {
|
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
function _classCallCheck(a, n) {
|
|
20
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
21
|
+
}
|
|
22
|
+
function _construct(t, e, r) {
|
|
23
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
24
|
+
var o = [null];
|
|
25
|
+
o.push.apply(o, e);
|
|
26
|
+
var p = new (t.bind.apply(t, o))();
|
|
27
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
28
|
+
}
|
|
29
|
+
function _defineProperties(e, r) {
|
|
30
|
+
for (var t = 0; t < r.length; t++) {
|
|
31
|
+
var o = r[t];
|
|
32
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function _createClass(e, r, t) {
|
|
36
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
37
|
+
writable: !1
|
|
38
|
+
}), e;
|
|
39
|
+
}
|
|
40
|
+
function _defineProperty(e, r, t) {
|
|
41
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
42
|
+
value: t,
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
configurable: !0,
|
|
45
|
+
writable: !0
|
|
46
|
+
}) : e[r] = t, e;
|
|
47
|
+
}
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
49
|
+
try {
|
|
50
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
51
|
+
} catch (t) {}
|
|
52
|
+
return (_isNativeReflectConstruct = function () {
|
|
53
|
+
return !!t;
|
|
54
|
+
})();
|
|
55
|
+
}
|
|
56
|
+
function _objectDestructuringEmpty(t) {
|
|
57
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
58
|
+
}
|
|
19
59
|
function ownKeys(e, r) {
|
|
20
60
|
var t = Object.keys(e);
|
|
21
61
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -37,91 +77,24 @@ function _objectSpread2(e) {
|
|
|
37
77
|
}
|
|
38
78
|
return e;
|
|
39
79
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function _defineProperties(target, props) {
|
|
46
|
-
for (var i = 0; i < props.length; i++) {
|
|
47
|
-
var descriptor = props[i];
|
|
48
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
49
|
-
descriptor.configurable = true;
|
|
50
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
51
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
55
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
56
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
57
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
58
|
-
writable: false
|
|
59
|
-
});
|
|
60
|
-
return Constructor;
|
|
80
|
+
function _setPrototypeOf(t, e) {
|
|
81
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
82
|
+
return t.__proto__ = e, t;
|
|
83
|
+
}, _setPrototypeOf(t, e);
|
|
61
84
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
configurable: true,
|
|
69
|
-
writable: true
|
|
70
|
-
});
|
|
71
|
-
} else {
|
|
72
|
-
obj[key] = value;
|
|
73
|
-
}
|
|
74
|
-
return obj;
|
|
75
|
-
}
|
|
76
|
-
function _setPrototypeOf(o, p) {
|
|
77
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
78
|
-
o.__proto__ = p;
|
|
79
|
-
return o;
|
|
80
|
-
};
|
|
81
|
-
return _setPrototypeOf(o, p);
|
|
82
|
-
}
|
|
83
|
-
function _isNativeReflectConstruct() {
|
|
84
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
85
|
-
if (Reflect.construct.sham) return false;
|
|
86
|
-
if (typeof Proxy === "function") return true;
|
|
87
|
-
try {
|
|
88
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
89
|
-
return true;
|
|
90
|
-
} catch (e) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function _construct(Parent, args, Class) {
|
|
95
|
-
if (_isNativeReflectConstruct()) {
|
|
96
|
-
_construct = Reflect.construct.bind();
|
|
97
|
-
} else {
|
|
98
|
-
_construct = function _construct(Parent, args, Class) {
|
|
99
|
-
var a = [null];
|
|
100
|
-
a.push.apply(a, args);
|
|
101
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
102
|
-
var instance = new Constructor();
|
|
103
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
104
|
-
return instance;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
return _construct.apply(null, arguments);
|
|
108
|
-
}
|
|
109
|
-
function _objectDestructuringEmpty(obj) {
|
|
110
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
111
|
-
}
|
|
112
|
-
function _toPrimitive(input, hint) {
|
|
113
|
-
if (typeof input !== "object" || input === null) return input;
|
|
114
|
-
var prim = input[Symbol.toPrimitive];
|
|
115
|
-
if (prim !== undefined) {
|
|
116
|
-
var res = prim.call(input, hint || "default");
|
|
117
|
-
if (typeof res !== "object") return res;
|
|
85
|
+
function _toPrimitive(t, r) {
|
|
86
|
+
if ("object" != typeof t || !t) return t;
|
|
87
|
+
var e = t[Symbol.toPrimitive];
|
|
88
|
+
if (void 0 !== e) {
|
|
89
|
+
var i = e.call(t, r || "default");
|
|
90
|
+
if ("object" != typeof i) return i;
|
|
118
91
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
119
92
|
}
|
|
120
|
-
return (
|
|
93
|
+
return ("string" === r ? String : Number)(t);
|
|
121
94
|
}
|
|
122
|
-
function _toPropertyKey(
|
|
123
|
-
var
|
|
124
|
-
return
|
|
95
|
+
function _toPropertyKey(t) {
|
|
96
|
+
var i = _toPrimitive(t, "string");
|
|
97
|
+
return "symbol" == typeof i ? i : i + "";
|
|
125
98
|
}
|
|
126
99
|
|
|
127
100
|
var checkPropType = function checkPropType(propType, value, name) {
|
|
@@ -215,7 +188,6 @@ var index = (function () {
|
|
|
215
188
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
216
189
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
217
190
|
}
|
|
218
|
-
|
|
219
191
|
defaultStorageType = storageType;
|
|
220
192
|
return {
|
|
221
193
|
setup: function setup(plugin, _ref2) {
|
|
@@ -232,6 +204,9 @@ var index = (function () {
|
|
|
232
204
|
if (existingPersistedValue !== undefined) {
|
|
233
205
|
return existingPersistedValue;
|
|
234
206
|
}
|
|
207
|
+
|
|
208
|
+
// Store initial value to localStorage for consistency across sessions
|
|
209
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
235
210
|
return value;
|
|
236
211
|
},
|
|
237
212
|
update: function update(value, _ref4) {
|
|
@@ -265,7 +240,7 @@ var plugin = function plugin(_ref) {
|
|
|
265
240
|
}
|
|
266
241
|
|
|
267
242
|
// either the initial state value or the next plugin
|
|
268
|
-
_createClass(_class, [{
|
|
243
|
+
return _createClass(_class, [{
|
|
269
244
|
key: "getValue",
|
|
270
245
|
value: function getValue() {
|
|
271
246
|
return this.value;
|
|
@@ -301,7 +276,6 @@ var plugin = function plugin(_ref) {
|
|
|
301
276
|
return value;
|
|
302
277
|
}
|
|
303
278
|
}]);
|
|
304
|
-
return _class;
|
|
305
279
|
}();
|
|
306
280
|
};
|
|
307
281
|
var addPlugin = function addPlugin(config) {
|
package/dist/plugins/index.js
CHANGED
|
@@ -24,6 +24,46 @@ var index$2 = (function (callback) {
|
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
function _classCallCheck(a, n) {
|
|
28
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
29
|
+
}
|
|
30
|
+
function _construct(t, e, r) {
|
|
31
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
32
|
+
var o = [null];
|
|
33
|
+
o.push.apply(o, e);
|
|
34
|
+
var p = new (t.bind.apply(t, o))();
|
|
35
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
36
|
+
}
|
|
37
|
+
function _defineProperties(e, r) {
|
|
38
|
+
for (var t = 0; t < r.length; t++) {
|
|
39
|
+
var o = r[t];
|
|
40
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function _createClass(e, r, t) {
|
|
44
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
45
|
+
writable: !1
|
|
46
|
+
}), e;
|
|
47
|
+
}
|
|
48
|
+
function _defineProperty(e, r, t) {
|
|
49
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
50
|
+
value: t,
|
|
51
|
+
enumerable: !0,
|
|
52
|
+
configurable: !0,
|
|
53
|
+
writable: !0
|
|
54
|
+
}) : e[r] = t, e;
|
|
55
|
+
}
|
|
56
|
+
function _isNativeReflectConstruct() {
|
|
57
|
+
try {
|
|
58
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
59
|
+
} catch (t) {}
|
|
60
|
+
return (_isNativeReflectConstruct = function () {
|
|
61
|
+
return !!t;
|
|
62
|
+
})();
|
|
63
|
+
}
|
|
64
|
+
function _objectDestructuringEmpty(t) {
|
|
65
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
66
|
+
}
|
|
27
67
|
function ownKeys(e, r) {
|
|
28
68
|
var t = Object.keys(e);
|
|
29
69
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -45,91 +85,24 @@ function _objectSpread2(e) {
|
|
|
45
85
|
}
|
|
46
86
|
return e;
|
|
47
87
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function _defineProperties(target, props) {
|
|
54
|
-
for (var i = 0; i < props.length; i++) {
|
|
55
|
-
var descriptor = props[i];
|
|
56
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
57
|
-
descriptor.configurable = true;
|
|
58
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
59
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
63
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
64
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
65
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
66
|
-
writable: false
|
|
67
|
-
});
|
|
68
|
-
return Constructor;
|
|
88
|
+
function _setPrototypeOf(t, e) {
|
|
89
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
90
|
+
return t.__proto__ = e, t;
|
|
91
|
+
}, _setPrototypeOf(t, e);
|
|
69
92
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true
|
|
78
|
-
});
|
|
79
|
-
} else {
|
|
80
|
-
obj[key] = value;
|
|
81
|
-
}
|
|
82
|
-
return obj;
|
|
83
|
-
}
|
|
84
|
-
function _setPrototypeOf(o, p) {
|
|
85
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
86
|
-
o.__proto__ = p;
|
|
87
|
-
return o;
|
|
88
|
-
};
|
|
89
|
-
return _setPrototypeOf(o, p);
|
|
90
|
-
}
|
|
91
|
-
function _isNativeReflectConstruct() {
|
|
92
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
93
|
-
if (Reflect.construct.sham) return false;
|
|
94
|
-
if (typeof Proxy === "function") return true;
|
|
95
|
-
try {
|
|
96
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
97
|
-
return true;
|
|
98
|
-
} catch (e) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function _construct(Parent, args, Class) {
|
|
103
|
-
if (_isNativeReflectConstruct()) {
|
|
104
|
-
_construct = Reflect.construct.bind();
|
|
105
|
-
} else {
|
|
106
|
-
_construct = function _construct(Parent, args, Class) {
|
|
107
|
-
var a = [null];
|
|
108
|
-
a.push.apply(a, args);
|
|
109
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
110
|
-
var instance = new Constructor();
|
|
111
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
112
|
-
return instance;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return _construct.apply(null, arguments);
|
|
116
|
-
}
|
|
117
|
-
function _objectDestructuringEmpty(obj) {
|
|
118
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
119
|
-
}
|
|
120
|
-
function _toPrimitive(input, hint) {
|
|
121
|
-
if (typeof input !== "object" || input === null) return input;
|
|
122
|
-
var prim = input[Symbol.toPrimitive];
|
|
123
|
-
if (prim !== undefined) {
|
|
124
|
-
var res = prim.call(input, hint || "default");
|
|
125
|
-
if (typeof res !== "object") return res;
|
|
93
|
+
function _toPrimitive(t, r) {
|
|
94
|
+
if ("object" != typeof t || !t) return t;
|
|
95
|
+
var e = t[Symbol.toPrimitive];
|
|
96
|
+
if (void 0 !== e) {
|
|
97
|
+
var i = e.call(t, r || "default");
|
|
98
|
+
if ("object" != typeof i) return i;
|
|
126
99
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
127
100
|
}
|
|
128
|
-
return (
|
|
101
|
+
return ("string" === r ? String : Number)(t);
|
|
129
102
|
}
|
|
130
|
-
function _toPropertyKey(
|
|
131
|
-
var
|
|
132
|
-
return
|
|
103
|
+
function _toPropertyKey(t) {
|
|
104
|
+
var i = _toPrimitive(t, "string");
|
|
105
|
+
return "symbol" == typeof i ? i : i + "";
|
|
133
106
|
}
|
|
134
107
|
|
|
135
108
|
var checkPropType = function checkPropType(propType, value, name) {
|
|
@@ -223,7 +196,6 @@ var index = (function () {
|
|
|
223
196
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
224
197
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
225
198
|
}
|
|
226
|
-
|
|
227
199
|
defaultStorageType = storageType;
|
|
228
200
|
return {
|
|
229
201
|
setup: function setup(plugin, _ref2) {
|
|
@@ -240,6 +212,9 @@ var index = (function () {
|
|
|
240
212
|
if (existingPersistedValue !== undefined) {
|
|
241
213
|
return existingPersistedValue;
|
|
242
214
|
}
|
|
215
|
+
|
|
216
|
+
// Store initial value to localStorage for consistency across sessions
|
|
217
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
243
218
|
return value;
|
|
244
219
|
},
|
|
245
220
|
update: function update(value, _ref4) {
|
|
@@ -273,7 +248,7 @@ var plugin = function plugin(_ref) {
|
|
|
273
248
|
}
|
|
274
249
|
|
|
275
250
|
// either the initial state value or the next plugin
|
|
276
|
-
_createClass(_class, [{
|
|
251
|
+
return _createClass(_class, [{
|
|
277
252
|
key: "getValue",
|
|
278
253
|
value: function getValue() {
|
|
279
254
|
return this.value;
|
|
@@ -309,7 +284,6 @@ var plugin = function plugin(_ref) {
|
|
|
309
284
|
return value;
|
|
310
285
|
}
|
|
311
286
|
}]);
|
|
312
|
-
return _class;
|
|
313
287
|
}();
|
|
314
288
|
};
|
|
315
289
|
var addPlugin = function addPlugin(config) {
|
|
@@ -20,6 +20,46 @@
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
function _classCallCheck(a, n) {
|
|
24
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
25
|
+
}
|
|
26
|
+
function _construct(t, e, r) {
|
|
27
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
28
|
+
var o = [null];
|
|
29
|
+
o.push.apply(o, e);
|
|
30
|
+
var p = new (t.bind.apply(t, o))();
|
|
31
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
32
|
+
}
|
|
33
|
+
function _defineProperties(e, r) {
|
|
34
|
+
for (var t = 0; t < r.length; t++) {
|
|
35
|
+
var o = r[t];
|
|
36
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function _createClass(e, r, t) {
|
|
40
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
41
|
+
writable: !1
|
|
42
|
+
}), e;
|
|
43
|
+
}
|
|
44
|
+
function _defineProperty(e, r, t) {
|
|
45
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
46
|
+
value: t,
|
|
47
|
+
enumerable: !0,
|
|
48
|
+
configurable: !0,
|
|
49
|
+
writable: !0
|
|
50
|
+
}) : e[r] = t, e;
|
|
51
|
+
}
|
|
52
|
+
function _isNativeReflectConstruct() {
|
|
53
|
+
try {
|
|
54
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
55
|
+
} catch (t) {}
|
|
56
|
+
return (_isNativeReflectConstruct = function () {
|
|
57
|
+
return !!t;
|
|
58
|
+
})();
|
|
59
|
+
}
|
|
60
|
+
function _objectDestructuringEmpty(t) {
|
|
61
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
62
|
+
}
|
|
23
63
|
function ownKeys(e, r) {
|
|
24
64
|
var t = Object.keys(e);
|
|
25
65
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -41,91 +81,24 @@
|
|
|
41
81
|
}
|
|
42
82
|
return e;
|
|
43
83
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function _defineProperties(target, props) {
|
|
50
|
-
for (var i = 0; i < props.length; i++) {
|
|
51
|
-
var descriptor = props[i];
|
|
52
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
53
|
-
descriptor.configurable = true;
|
|
54
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
55
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
59
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
61
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
62
|
-
writable: false
|
|
63
|
-
});
|
|
64
|
-
return Constructor;
|
|
84
|
+
function _setPrototypeOf(t, e) {
|
|
85
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
86
|
+
return t.__proto__ = e, t;
|
|
87
|
+
}, _setPrototypeOf(t, e);
|
|
65
88
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
configurable: true,
|
|
73
|
-
writable: true
|
|
74
|
-
});
|
|
75
|
-
} else {
|
|
76
|
-
obj[key] = value;
|
|
77
|
-
}
|
|
78
|
-
return obj;
|
|
79
|
-
}
|
|
80
|
-
function _setPrototypeOf(o, p) {
|
|
81
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
82
|
-
o.__proto__ = p;
|
|
83
|
-
return o;
|
|
84
|
-
};
|
|
85
|
-
return _setPrototypeOf(o, p);
|
|
86
|
-
}
|
|
87
|
-
function _isNativeReflectConstruct() {
|
|
88
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
89
|
-
if (Reflect.construct.sham) return false;
|
|
90
|
-
if (typeof Proxy === "function") return true;
|
|
91
|
-
try {
|
|
92
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
93
|
-
return true;
|
|
94
|
-
} catch (e) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function _construct(Parent, args, Class) {
|
|
99
|
-
if (_isNativeReflectConstruct()) {
|
|
100
|
-
_construct = Reflect.construct.bind();
|
|
101
|
-
} else {
|
|
102
|
-
_construct = function _construct(Parent, args, Class) {
|
|
103
|
-
var a = [null];
|
|
104
|
-
a.push.apply(a, args);
|
|
105
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
106
|
-
var instance = new Constructor();
|
|
107
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
108
|
-
return instance;
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
return _construct.apply(null, arguments);
|
|
112
|
-
}
|
|
113
|
-
function _objectDestructuringEmpty(obj) {
|
|
114
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
115
|
-
}
|
|
116
|
-
function _toPrimitive(input, hint) {
|
|
117
|
-
if (typeof input !== "object" || input === null) return input;
|
|
118
|
-
var prim = input[Symbol.toPrimitive];
|
|
119
|
-
if (prim !== undefined) {
|
|
120
|
-
var res = prim.call(input, hint || "default");
|
|
121
|
-
if (typeof res !== "object") return res;
|
|
89
|
+
function _toPrimitive(t, r) {
|
|
90
|
+
if ("object" != typeof t || !t) return t;
|
|
91
|
+
var e = t[Symbol.toPrimitive];
|
|
92
|
+
if (void 0 !== e) {
|
|
93
|
+
var i = e.call(t, r || "default");
|
|
94
|
+
if ("object" != typeof i) return i;
|
|
122
95
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
123
96
|
}
|
|
124
|
-
return (
|
|
97
|
+
return ("string" === r ? String : Number)(t);
|
|
125
98
|
}
|
|
126
|
-
function _toPropertyKey(
|
|
127
|
-
var
|
|
128
|
-
return
|
|
99
|
+
function _toPropertyKey(t) {
|
|
100
|
+
var i = _toPrimitive(t, "string");
|
|
101
|
+
return "symbol" == typeof i ? i : i + "";
|
|
129
102
|
}
|
|
130
103
|
|
|
131
104
|
var checkPropTypes$1 = {exports: {}};
|
|
@@ -303,7 +276,6 @@
|
|
|
303
276
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
304
277
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
305
278
|
}
|
|
306
|
-
|
|
307
279
|
defaultStorageType = storageType;
|
|
308
280
|
return {
|
|
309
281
|
setup: function setup(plugin, _ref2) {
|
|
@@ -320,6 +292,9 @@
|
|
|
320
292
|
if (existingPersistedValue !== undefined) {
|
|
321
293
|
return existingPersistedValue;
|
|
322
294
|
}
|
|
295
|
+
|
|
296
|
+
// Store initial value to localStorage for consistency across sessions
|
|
297
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
323
298
|
return value;
|
|
324
299
|
},
|
|
325
300
|
update: function update(value, _ref4) {
|
|
@@ -353,7 +328,7 @@
|
|
|
353
328
|
}
|
|
354
329
|
|
|
355
330
|
// either the initial state value or the next plugin
|
|
356
|
-
_createClass(_class, [{
|
|
331
|
+
return _createClass(_class, [{
|
|
357
332
|
key: "getValue",
|
|
358
333
|
value: function getValue() {
|
|
359
334
|
return this.value;
|
|
@@ -389,7 +364,6 @@
|
|
|
389
364
|
return value;
|
|
390
365
|
}
|
|
391
366
|
}]);
|
|
392
|
-
return _class;
|
|
393
367
|
}();
|
|
394
368
|
};
|
|
395
369
|
var addPlugin = function addPlugin(config) {
|
|
@@ -38,7 +38,6 @@ var index = (function () {
|
|
|
38
38
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
39
39
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
defaultStorageType = storageType;
|
|
43
42
|
return {
|
|
44
43
|
setup: function setup(plugin, _ref2) {
|
|
@@ -55,6 +54,9 @@ var index = (function () {
|
|
|
55
54
|
if (existingPersistedValue !== undefined) {
|
|
56
55
|
return existingPersistedValue;
|
|
57
56
|
}
|
|
57
|
+
|
|
58
|
+
// Store initial value to localStorage for consistency across sessions
|
|
59
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
58
60
|
return value;
|
|
59
61
|
},
|
|
60
62
|
update: function update(value, _ref4) {
|
|
@@ -42,7 +42,6 @@ var index = (function () {
|
|
|
42
42
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
43
43
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
44
44
|
}
|
|
45
|
-
|
|
46
45
|
defaultStorageType = storageType;
|
|
47
46
|
return {
|
|
48
47
|
setup: function setup(plugin, _ref2) {
|
|
@@ -59,6 +58,9 @@ var index = (function () {
|
|
|
59
58
|
if (existingPersistedValue !== undefined) {
|
|
60
59
|
return existingPersistedValue;
|
|
61
60
|
}
|
|
61
|
+
|
|
62
|
+
// Store initial value to localStorage for consistency across sessions
|
|
63
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
62
64
|
return value;
|
|
63
65
|
},
|
|
64
66
|
update: function update(value, _ref4) {
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
if (!isLocalStorageAvaialble && !storageType) {
|
|
45
45
|
console.warn("localStorage is not available! You must provide your own storage to persist"); // eslint-disable-line no-console
|
|
46
46
|
}
|
|
47
|
-
|
|
48
47
|
defaultStorageType = storageType;
|
|
49
48
|
return {
|
|
50
49
|
setup: function setup(plugin, _ref2) {
|
|
@@ -61,6 +60,9 @@
|
|
|
61
60
|
if (existingPersistedValue !== undefined) {
|
|
62
61
|
return existingPersistedValue;
|
|
63
62
|
}
|
|
63
|
+
|
|
64
|
+
// Store initial value to localStorage for consistency across sessions
|
|
65
|
+
storePersistedValue(key, sliceConfig.name, value, storageType);
|
|
64
66
|
return value;
|
|
65
67
|
},
|
|
66
68
|
update: function update(value, _ref4) {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import checkPropTypes from 'check-prop-types';
|
|
2
2
|
|
|
3
|
+
function _defineProperty(e, r, t) {
|
|
4
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
|
+
value: t,
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
writable: !0
|
|
9
|
+
}) : e[r] = t, e;
|
|
10
|
+
}
|
|
3
11
|
function ownKeys(e, r) {
|
|
4
12
|
var t = Object.keys(e);
|
|
5
13
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -21,33 +29,19 @@ function _objectSpread2(e) {
|
|
|
21
29
|
}
|
|
22
30
|
return e;
|
|
23
31
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true
|
|
32
|
-
});
|
|
33
|
-
} else {
|
|
34
|
-
obj[key] = value;
|
|
35
|
-
}
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
38
|
-
function _toPrimitive(input, hint) {
|
|
39
|
-
if (typeof input !== "object" || input === null) return input;
|
|
40
|
-
var prim = input[Symbol.toPrimitive];
|
|
41
|
-
if (prim !== undefined) {
|
|
42
|
-
var res = prim.call(input, hint || "default");
|
|
43
|
-
if (typeof res !== "object") return res;
|
|
32
|
+
function _toPrimitive(t, r) {
|
|
33
|
+
if ("object" != typeof t || !t) return t;
|
|
34
|
+
var e = t[Symbol.toPrimitive];
|
|
35
|
+
if (void 0 !== e) {
|
|
36
|
+
var i = e.call(t, r || "default");
|
|
37
|
+
if ("object" != typeof i) return i;
|
|
44
38
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
45
39
|
}
|
|
46
|
-
return (
|
|
40
|
+
return ("string" === r ? String : Number)(t);
|
|
47
41
|
}
|
|
48
|
-
function _toPropertyKey(
|
|
49
|
-
var
|
|
50
|
-
return
|
|
42
|
+
function _toPropertyKey(t) {
|
|
43
|
+
var i = _toPrimitive(t, "string");
|
|
44
|
+
return "symbol" == typeof i ? i : i + "";
|
|
51
45
|
}
|
|
52
46
|
|
|
53
47
|
var checkPropType = function checkPropType(propType, value, name) {
|