dataflux 1.14.3 → 1.14.5
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/BasicObj.js +24 -39
- package/dist/Model.js +177 -252
- package/dist/Obj.js +33 -39
- package/dist/ObserverStore.js +102 -128
- package/dist/PersistentStore.js +15 -17
- package/dist/PubSub.js +2 -2
- package/dist/ReactStore.js +40 -47
- package/dist/Store.js +58 -78
- package/dist/SubObj.js +31 -43
- package/dist/dataflux.min.js +1 -1
- package/dist/dataflux.min.js.map +1 -1
- package/dist/modelHooksUtils.js +2 -2
- package/package.json +13 -13
package/dist/Obj.js
CHANGED
|
@@ -12,25 +12,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
12
12
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
-
function
|
|
16
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
16
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
22
22
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
23
23
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
24
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
function _toPropertyKey(
|
|
26
|
-
function _toPrimitive(
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
27
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
28
28
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
29
|
-
function _classPrivateFieldSet(
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
33
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } /*
|
|
29
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
30
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
31
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
|
|
34
32
|
* MIT License
|
|
35
33
|
*
|
|
36
34
|
* Copyright (c) 2022 Massimo Candela <https://massimocandela.com>
|
|
@@ -55,61 +53,57 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
|
|
|
55
53
|
*/
|
|
56
54
|
var _loaded = /*#__PURE__*/new WeakMap();
|
|
57
55
|
var Obj = exports["default"] = /*#__PURE__*/function (_BasicObj) {
|
|
58
|
-
_inherits(Obj, _BasicObj);
|
|
59
|
-
var _super = _createSuper(Obj);
|
|
60
56
|
function Obj(values, _model) {
|
|
61
|
-
var
|
|
57
|
+
var _this;
|
|
62
58
|
_classCallCheck(this, Obj);
|
|
63
|
-
_this =
|
|
64
|
-
_classPrivateFieldInitSpec(
|
|
65
|
-
|
|
66
|
-
value: false
|
|
67
|
-
});
|
|
68
|
-
_defineProperty(_assertThisInitialized(_this), "set", function (attribute, value, hidden) {
|
|
59
|
+
_this = _callSuper(this, Obj, [values, _model]);
|
|
60
|
+
_classPrivateFieldInitSpec(_this, _loaded, false);
|
|
61
|
+
_defineProperty(_this, "set", function (attribute, value, hidden) {
|
|
69
62
|
if (Array.isArray(value) && _this.getModel().options.deep) {
|
|
70
63
|
value = value.map(function (i) {
|
|
71
64
|
if (["boolean", "string", "number"].includes(_typeof(i))) {
|
|
72
65
|
return i;
|
|
73
66
|
} else {
|
|
74
|
-
return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](
|
|
67
|
+
return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](_this, "property", i, _this.getModel());
|
|
75
68
|
}
|
|
76
69
|
});
|
|
77
70
|
}
|
|
78
|
-
return _get((
|
|
71
|
+
return _get((_this, _getPrototypeOf(Obj.prototype)), "set", _this).call(_this, attribute, value, hidden);
|
|
79
72
|
});
|
|
80
|
-
_defineProperty(
|
|
81
|
-
if (_classPrivateFieldGet(
|
|
82
|
-
return Promise.resolve(
|
|
73
|
+
_defineProperty(_this, "load", function () {
|
|
74
|
+
if (_classPrivateFieldGet(_loaded, _this)) {
|
|
75
|
+
return Promise.resolve(_this);
|
|
83
76
|
} else {
|
|
84
77
|
var model = _this.getModel();
|
|
85
|
-
return model.load(
|
|
86
|
-
_classPrivateFieldSet(
|
|
87
|
-
return model.getStore().update([
|
|
78
|
+
return model.load(_this).then(function () {
|
|
79
|
+
_classPrivateFieldSet(_loaded, _this, true);
|
|
80
|
+
return model.getStore().update([_this], true); // Propagate update
|
|
88
81
|
}).then(function () {
|
|
89
|
-
return
|
|
82
|
+
return _this;
|
|
90
83
|
}); // return always this
|
|
91
84
|
}
|
|
92
85
|
});
|
|
93
|
-
_defineProperty(
|
|
86
|
+
_defineProperty(_this, "getFingerprint", function () {
|
|
94
87
|
return (0, _fingerprint["default"])(_this.toJSON());
|
|
95
88
|
});
|
|
96
|
-
_defineProperty(
|
|
97
|
-
return _this.getModel().getRelation(
|
|
89
|
+
_defineProperty(_this, "getRelation", function (type, filterFunction) {
|
|
90
|
+
return _this.getModel().getRelation(_this, type, filterFunction);
|
|
98
91
|
});
|
|
99
|
-
_defineProperty(
|
|
100
|
-
return _this.getModel().getStore().save([
|
|
92
|
+
_defineProperty(_this, "save", function () {
|
|
93
|
+
return _this.getModel().getStore().save([_this]);
|
|
101
94
|
});
|
|
102
|
-
_defineProperty(
|
|
103
|
-
return _this.getModel().getStore()["delete"]([
|
|
95
|
+
_defineProperty(_this, "destroy", function () {
|
|
96
|
+
return _this.getModel().getStore()["delete"]([_this]);
|
|
104
97
|
});
|
|
105
|
-
_defineProperty(
|
|
106
|
-
return _this.getModel().getStore().update([
|
|
98
|
+
_defineProperty(_this, "update", function () {
|
|
99
|
+
return _this.getModel().getStore().update([_this]);
|
|
107
100
|
});
|
|
108
|
-
(0, _BasicObj2.setValues)(values, _model, _SubObj["default"],
|
|
101
|
+
(0, _BasicObj2.setValues)(values, _model, _SubObj["default"], _this, _this);
|
|
109
102
|
_this.getModel = function () {
|
|
110
103
|
return _model;
|
|
111
104
|
};
|
|
112
105
|
return _this;
|
|
113
106
|
}
|
|
107
|
+
_inherits(Obj, _BasicObj);
|
|
114
108
|
return _createClass(Obj);
|
|
115
109
|
}(_BasicObj2.BasicObj);
|
package/dist/ObserverStore.js
CHANGED
|
@@ -19,27 +19,24 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
19
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
20
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
21
21
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
26
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
23
27
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
28
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
29
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
30
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
27
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
28
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
31
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
32
32
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
function _toPropertyKey(
|
|
34
|
-
function _toPrimitive(
|
|
33
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
34
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
35
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
36
36
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
37
|
-
function
|
|
38
|
-
function
|
|
39
|
-
function
|
|
40
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
|
41
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
42
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } /*
|
|
37
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
38
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
39
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
|
|
43
40
|
* MIT License
|
|
44
41
|
*
|
|
45
42
|
* Copyright (c) 2022 Massimo Candela <https://massimocandela.com>
|
|
@@ -69,24 +66,16 @@ var _propagateChange = /*#__PURE__*/new WeakMap();
|
|
|
69
66
|
var _appendIfNotExistent = /*#__PURE__*/new WeakMap();
|
|
70
67
|
var _subscribeToObjects = /*#__PURE__*/new WeakMap();
|
|
71
68
|
var _merge = /*#__PURE__*/new WeakMap();
|
|
72
|
-
var
|
|
69
|
+
var _ObserverStore_brand = /*#__PURE__*/new WeakSet();
|
|
73
70
|
var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
74
|
-
_inherits(ObserverStore, _PersistentStore);
|
|
75
|
-
var _super = _createSuper(ObserverStore);
|
|
76
71
|
function ObserverStore(options) {
|
|
77
72
|
var _this;
|
|
78
73
|
_classCallCheck(this, ObserverStore);
|
|
79
|
-
_this =
|
|
80
|
-
_classPrivateMethodInitSpec(
|
|
81
|
-
_classPrivateFieldInitSpec(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _unsubPromises, {
|
|
86
|
-
writable: true,
|
|
87
|
-
value: []
|
|
88
|
-
});
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "multipleSubscribe", function (subscriptions, callback) {
|
|
74
|
+
_this = _callSuper(this, ObserverStore, [options]);
|
|
75
|
+
_classPrivateMethodInitSpec(_this, _ObserverStore_brand);
|
|
76
|
+
_classPrivateFieldInitSpec(_this, _queryPromises, []);
|
|
77
|
+
_classPrivateFieldInitSpec(_this, _unsubPromises, []);
|
|
78
|
+
_defineProperty(_this, "multipleSubscribe", function (subscriptions, callback) {
|
|
90
79
|
var dataPayload = {};
|
|
91
80
|
var subKey = (0, _uuid.v4)();
|
|
92
81
|
var areAllDone = function areAllDone() {
|
|
@@ -114,23 +103,23 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
114
103
|
});
|
|
115
104
|
return subKey;
|
|
116
105
|
});
|
|
117
|
-
_defineProperty(
|
|
106
|
+
_defineProperty(_this, "subscribe", function (type, callback, filterFunction) {
|
|
118
107
|
var _this$_subscribed, _this$_subscribed$typ;
|
|
119
108
|
var subKey = (0, _uuid.v4)();
|
|
120
109
|
(_this$_subscribed$typ = (_this$_subscribed = _this._subscribed)[type]) !== null && _this$_subscribed$typ !== void 0 ? _this$_subscribed$typ : _this$_subscribed[type] = {};
|
|
121
110
|
var prom = _this.find(type, filterFunction).then(function (data) {
|
|
122
|
-
_classPrivateFieldGet(
|
|
111
|
+
_classPrivateFieldGet(_subscribeToObjects, _this).call(_this, type, data, {
|
|
123
112
|
callback: callback,
|
|
124
113
|
filterFunction: filterFunction,
|
|
125
114
|
subKey: subKey
|
|
126
115
|
});
|
|
127
116
|
callback(data);
|
|
128
117
|
});
|
|
129
|
-
_classPrivateFieldGet(
|
|
118
|
+
_classPrivateFieldGet(_queryPromises, _this).push(prom);
|
|
130
119
|
return subKey;
|
|
131
120
|
});
|
|
132
|
-
_defineProperty(
|
|
133
|
-
_classPrivateFieldSet(
|
|
121
|
+
_defineProperty(_this, "unsubscribe", function (key) {
|
|
122
|
+
_classPrivateFieldSet(_unsubPromises, _this, (_classPrivateFieldGet(_queryPromises, _this).length ? Promise.all(_classPrivateFieldGet(_queryPromises, _this)) : Promise.resolve()).then(function () {
|
|
134
123
|
if (_this._multipleSubscribed[key]) {
|
|
135
124
|
var _iterator = _createForOfIteratorHelper(_this._multipleSubscribed[key]),
|
|
136
125
|
_step;
|
|
@@ -164,99 +153,87 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
164
153
|
}
|
|
165
154
|
}));
|
|
166
155
|
});
|
|
167
|
-
_classPrivateFieldInitSpec(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var sub = _step3.value;
|
|
185
|
-
(_out$_sub$subKey = out[_sub$subKey = sub.subKey]) !== null && _out$_sub$subKey !== void 0 ? _out$_sub$subKey : out[_sub$subKey] = sub;
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
_iterator3.e(err);
|
|
189
|
-
} finally {
|
|
190
|
-
_iterator3.f();
|
|
156
|
+
_classPrivateFieldInitSpec(_this, _getUniqueSubs, function (objects, type) {
|
|
157
|
+
var out = {};
|
|
158
|
+
var _iterator2 = _createForOfIteratorHelper(objects),
|
|
159
|
+
_step2;
|
|
160
|
+
try {
|
|
161
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
162
|
+
var object = _step2.value;
|
|
163
|
+
var objectId = object.getId();
|
|
164
|
+
var typeChannel = _this._subscribed[type] || {};
|
|
165
|
+
var subscribedToObject = typeChannel[objectId] || [];
|
|
166
|
+
var _iterator3 = _createForOfIteratorHelper(subscribedToObject),
|
|
167
|
+
_step3;
|
|
168
|
+
try {
|
|
169
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
170
|
+
var _sub$subKey, _out$_sub$subKey;
|
|
171
|
+
var sub = _step3.value;
|
|
172
|
+
(_out$_sub$subKey = out[_sub$subKey = sub.subKey]) !== null && _out$_sub$subKey !== void 0 ? _out$_sub$subKey : out[_sub$subKey] = sub;
|
|
191
173
|
}
|
|
174
|
+
} catch (err) {
|
|
175
|
+
_iterator3.e(err);
|
|
176
|
+
} finally {
|
|
177
|
+
_iterator3.f();
|
|
192
178
|
}
|
|
193
|
-
} catch (err) {
|
|
194
|
-
_iterator2.e(err);
|
|
195
|
-
} finally {
|
|
196
|
-
_iterator2.f();
|
|
197
179
|
}
|
|
198
|
-
|
|
180
|
+
} catch (err) {
|
|
181
|
+
_iterator2.e(err);
|
|
182
|
+
} finally {
|
|
183
|
+
_iterator2.f();
|
|
199
184
|
}
|
|
185
|
+
return Object.values(out);
|
|
200
186
|
});
|
|
201
|
-
_classPrivateFieldInitSpec(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return _this.find(type, filterFunction).then(callback);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
return objects;
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _appendIfNotExistent, {
|
|
220
|
-
writable: true,
|
|
221
|
-
value: function value(arr, item) {
|
|
222
|
-
if (Object.values(arr).filter(function (_ref4) {
|
|
223
|
-
var subKey = _ref4.subKey;
|
|
224
|
-
return item.subKey === subKey;
|
|
225
|
-
}).length === 0) {
|
|
226
|
-
arr.push(item);
|
|
187
|
+
_classPrivateFieldInitSpec(_this, _propagateChange, function () {
|
|
188
|
+
var objects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
189
|
+
return (_classPrivateFieldGet(_unsubPromises, _this).length ? Promise.all(_classPrivateFieldGet(_unsubPromises, _this)) : Promise.resolve()).then(function () {
|
|
190
|
+
if (objects.length) {
|
|
191
|
+
var type = objects[0].getModel().getType();
|
|
192
|
+
var uniqueSubs = _classPrivateFieldGet(_getUniqueSubs, _this).call(_this, objects, type);
|
|
193
|
+
(0, _batchPromises["default"])(10, uniqueSubs, function (_ref3) {
|
|
194
|
+
var callback = _ref3.callback,
|
|
195
|
+
filterFunction = _ref3.filterFunction;
|
|
196
|
+
return _this.find(type, filterFunction).then(callback);
|
|
197
|
+
});
|
|
227
198
|
}
|
|
199
|
+
return objects;
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
_classPrivateFieldInitSpec(_this, _appendIfNotExistent, function (arr, item) {
|
|
203
|
+
if (Object.values(arr).filter(function (_ref4) {
|
|
204
|
+
var subKey = _ref4.subKey;
|
|
205
|
+
return item.subKey === subKey;
|
|
206
|
+
}).length === 0) {
|
|
207
|
+
arr.push(item);
|
|
228
208
|
}
|
|
229
209
|
});
|
|
230
|
-
_classPrivateFieldInitSpec(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(_this$_subscribed$typ5 = (_this$_subscribed$typ4 = _this._subscribed[type])[id]) !== null && _this$_subscribed$typ5 !== void 0 ? _this$_subscribed$typ5 : _this$_subscribed$typ4[id] = [];
|
|
242
|
-
_classPrivateFieldGet(_assertThisInitialized(_this), _appendIfNotExistent).call(_assertThisInitialized(_this), _this._subscribed[type][id], item);
|
|
243
|
-
}
|
|
244
|
-
} catch (err) {
|
|
245
|
-
_iterator4.e(err);
|
|
246
|
-
} finally {
|
|
247
|
-
_iterator4.f();
|
|
210
|
+
_classPrivateFieldInitSpec(_this, _subscribeToObjects, function (type, objectsToSubscribe, item) {
|
|
211
|
+
var _this$_subscribed$typ2, _, _this$_subscribed$typ3;
|
|
212
|
+
var _iterator4 = _createForOfIteratorHelper(objectsToSubscribe),
|
|
213
|
+
_step4;
|
|
214
|
+
try {
|
|
215
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
216
|
+
var _this$_subscribed$typ4, _this$_subscribed$typ5;
|
|
217
|
+
var object = _step4.value;
|
|
218
|
+
var id = object.getId();
|
|
219
|
+
(_this$_subscribed$typ5 = (_this$_subscribed$typ4 = _this._subscribed[type])[id]) !== null && _this$_subscribed$typ5 !== void 0 ? _this$_subscribed$typ5 : _this$_subscribed$typ4[id] = [];
|
|
220
|
+
_classPrivateFieldGet(_appendIfNotExistent, _this).call(_this, _this._subscribed[type][id], item);
|
|
248
221
|
}
|
|
249
|
-
|
|
250
|
-
|
|
222
|
+
} catch (err) {
|
|
223
|
+
_iterator4.e(err);
|
|
224
|
+
} finally {
|
|
225
|
+
_iterator4.f();
|
|
251
226
|
}
|
|
227
|
+
(_this$_subscribed$typ3 = (_this$_subscribed$typ2 = _this._subscribed[type])[_ = "*"]) !== null && _this$_subscribed$typ3 !== void 0 ? _this$_subscribed$typ3 : _this$_subscribed$typ2[_] = [];
|
|
228
|
+
_classPrivateFieldGet(_appendIfNotExistent, _this).call(_this, _this._subscribed[type]["*"], item);
|
|
252
229
|
});
|
|
253
|
-
_defineProperty(
|
|
230
|
+
_defineProperty(_this, "reset", function (type) {
|
|
254
231
|
return _this._refresh(type, true);
|
|
255
232
|
});
|
|
256
|
-
_defineProperty(
|
|
233
|
+
_defineProperty(_this, "refresh", function (type) {
|
|
257
234
|
return _this._refresh(type, false);
|
|
258
235
|
});
|
|
259
|
-
_defineProperty(
|
|
236
|
+
_defineProperty(_this, "_refresh", function (type, force) {
|
|
260
237
|
var refreshByType = function refreshByType(type) {
|
|
261
238
|
_this.pubSub.publish("refresh", {
|
|
262
239
|
status: "start",
|
|
@@ -268,7 +245,7 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
268
245
|
updated = _ref6[1],
|
|
269
246
|
deleted = _ref6[2];
|
|
270
247
|
var item = _this.models[type];
|
|
271
|
-
return Promise.all([
|
|
248
|
+
return Promise.all([_assertClassBrand(_ObserverStore_brand, _this, _propagateInsertChange).call(_this, type, inserted), _classPrivateFieldGet(_propagateChange, _this).call(_this, updated), _classPrivateFieldGet(_propagateChange, _this).call(_this, deleted)]).then(function () {
|
|
272
249
|
_this.pubSub.publish("refresh", {
|
|
273
250
|
status: "end",
|
|
274
251
|
model: type
|
|
@@ -283,14 +260,11 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
283
260
|
return Promise.all(Object.keys(_this.models).map(refreshByType));
|
|
284
261
|
}
|
|
285
262
|
});
|
|
286
|
-
_classPrivateFieldInitSpec(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
for (var key in newObject) {
|
|
290
|
-
originalObject[key] = newObject[key];
|
|
291
|
-
}
|
|
292
|
-
originalObject.update();
|
|
263
|
+
_classPrivateFieldInitSpec(_this, _merge, function (originalObject, newObject) {
|
|
264
|
+
for (var key in newObject) {
|
|
265
|
+
originalObject[key] = newObject[key];
|
|
293
266
|
}
|
|
267
|
+
originalObject.update();
|
|
294
268
|
});
|
|
295
269
|
_this._subscribed = {};
|
|
296
270
|
_this._multipleSubscribed = {};
|
|
@@ -299,13 +273,14 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
299
273
|
}
|
|
300
274
|
return _this;
|
|
301
275
|
}
|
|
302
|
-
|
|
276
|
+
_inherits(ObserverStore, _PersistentStore);
|
|
277
|
+
return _createClass(ObserverStore, [{
|
|
303
278
|
key: "update",
|
|
304
279
|
value: function update(objects, skipSave) {
|
|
305
280
|
if (!skipSave) {
|
|
306
|
-
_classPrivateFieldGet(
|
|
281
|
+
_classPrivateFieldGet(_propagateChange, this).call(this, objects);
|
|
307
282
|
}
|
|
308
|
-
return _get(_getPrototypeOf(ObserverStore.prototype), "update", this).call(this, objects, skipSave).then(_classPrivateFieldGet(
|
|
283
|
+
return _get(_getPrototypeOf(ObserverStore.prototype), "update", this).call(this, objects, skipSave).then(_classPrivateFieldGet(_propagateChange, this));
|
|
309
284
|
}
|
|
310
285
|
}, {
|
|
311
286
|
key: "insert",
|
|
@@ -313,7 +288,7 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
313
288
|
var _this2 = this;
|
|
314
289
|
objects = Array.isArray(objects) ? objects : [objects];
|
|
315
290
|
return _get(_getPrototypeOf(ObserverStore.prototype), "insert", this).call(this, type, objects).then(function (objects) {
|
|
316
|
-
|
|
291
|
+
_assertClassBrand(_ObserverStore_brand, _this2, _propagateInsertChange).call(_this2, type, objects);
|
|
317
292
|
return objects;
|
|
318
293
|
});
|
|
319
294
|
}
|
|
@@ -323,21 +298,20 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
323
298
|
var _this3 = this;
|
|
324
299
|
objects = Array.isArray(objects) ? objects : [objects];
|
|
325
300
|
return _get(_getPrototypeOf(ObserverStore.prototype), "mock", this).call(this, type, objects).then(function (objects) {
|
|
326
|
-
|
|
301
|
+
_assertClassBrand(_ObserverStore_brand, _this3, _propagateInsertChange).call(_this3, type, objects);
|
|
327
302
|
return objects;
|
|
328
303
|
});
|
|
329
304
|
}
|
|
330
305
|
}, {
|
|
331
306
|
key: "delete",
|
|
332
307
|
value: function _delete(typeOrObjects, filterFunction) {
|
|
333
|
-
return _get(_getPrototypeOf(ObserverStore.prototype), "delete", this).call(this, typeOrObjects, filterFunction).then(_classPrivateFieldGet(
|
|
308
|
+
return _get(_getPrototypeOf(ObserverStore.prototype), "delete", this).call(this, typeOrObjects, filterFunction).then(_classPrivateFieldGet(_propagateChange, this));
|
|
334
309
|
}
|
|
335
310
|
}]);
|
|
336
|
-
return ObserverStore;
|
|
337
311
|
}(_PersistentStore2["default"]);
|
|
338
|
-
function
|
|
312
|
+
function _propagateInsertChange(type, newObjects) {
|
|
339
313
|
var _this4 = this;
|
|
340
|
-
return (_classPrivateFieldGet(
|
|
314
|
+
return (_classPrivateFieldGet(_unsubPromises, this).length ? Promise.all(_classPrivateFieldGet(_unsubPromises, this)) : Promise.resolve()).then(function () {
|
|
341
315
|
if (_this4._subscribed[type]) {
|
|
342
316
|
var uniqueSubs = {};
|
|
343
317
|
var objects = Object.values(_this4._subscribed[type]);
|
|
@@ -368,7 +342,7 @@ function _propagateInsertChange2(type, newObjects) {
|
|
|
368
342
|
// Check if the new objects matter
|
|
369
343
|
|
|
370
344
|
return _this4.find(type, filterFunction).then(function (data) {
|
|
371
|
-
_classPrivateFieldGet(
|
|
345
|
+
_classPrivateFieldGet(_subscribeToObjects, _this4).call(_this4, type, objectsToSubscribe, {
|
|
372
346
|
callback: callback,
|
|
373
347
|
filterFunction: filterFunction,
|
|
374
348
|
subKey: subKey
|
package/dist/PersistentStore.js
CHANGED
|
@@ -13,18 +13,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
20
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
17
21
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
23
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
24
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
25
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
-
function _toPropertyKey(
|
|
27
|
-
function _toPrimitive(
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
28
28
|
* MIT License
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) 2022 Massimo Candela <https://massimocandela.com>
|
|
@@ -48,13 +48,11 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
48
48
|
* SOFTWARE.
|
|
49
49
|
*/
|
|
50
50
|
var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
51
|
-
_inherits(PersistentStore, _Store);
|
|
52
|
-
var _super = _createSuper(PersistentStore);
|
|
53
51
|
function PersistentStore(options) {
|
|
54
52
|
var _this;
|
|
55
53
|
_classCallCheck(this, PersistentStore);
|
|
56
|
-
_this =
|
|
57
|
-
_defineProperty(
|
|
54
|
+
_this = _callSuper(this, PersistentStore, [options]);
|
|
55
|
+
_defineProperty(_this, "whenSaved", function (type) {
|
|
58
56
|
return _this.getDiff(type).then(function (_ref) {
|
|
59
57
|
var inserted = _ref.inserted,
|
|
60
58
|
updated = _ref.updated,
|
|
@@ -72,7 +70,7 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
|
72
70
|
}
|
|
73
71
|
});
|
|
74
72
|
});
|
|
75
|
-
_defineProperty(
|
|
73
|
+
_defineProperty(_this, "save", function () {
|
|
76
74
|
_this._busy = true;
|
|
77
75
|
_this.pubSub.publish("save", "start");
|
|
78
76
|
if (_this._delayedSaveTimer) {
|
|
@@ -91,7 +89,7 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
|
91
89
|
return Promise.reject(error);
|
|
92
90
|
});
|
|
93
91
|
});
|
|
94
|
-
_defineProperty(
|
|
92
|
+
_defineProperty(_this, "_saveDiff", function (type, _ref2) {
|
|
95
93
|
var inserted = _ref2.inserted,
|
|
96
94
|
updated = _ref2.updated,
|
|
97
95
|
deleted = _ref2.deleted;
|
|
@@ -136,12 +134,12 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
|
136
134
|
}, type);
|
|
137
135
|
});
|
|
138
136
|
});
|
|
139
|
-
_defineProperty(
|
|
137
|
+
_defineProperty(_this, "_saveByType", function (type, ifLoaded) {
|
|
140
138
|
return _this.getDiff(type, ifLoaded).then(function (diff) {
|
|
141
139
|
return _this._saveDiff(type, diff);
|
|
142
140
|
});
|
|
143
141
|
});
|
|
144
|
-
_defineProperty(
|
|
142
|
+
_defineProperty(_this, "delayedSave", function () {
|
|
145
143
|
return new Promise(function (resolve, reject) {
|
|
146
144
|
if (_this.options.autoSave) {
|
|
147
145
|
if (_this._delayedSaveTimer) {
|
|
@@ -174,7 +172,8 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
|
174
172
|
}
|
|
175
173
|
return _this;
|
|
176
174
|
}
|
|
177
|
-
|
|
175
|
+
_inherits(PersistentStore, _Store);
|
|
176
|
+
return _createClass(PersistentStore, [{
|
|
178
177
|
key: "addModel",
|
|
179
178
|
value: function addModel(model) {
|
|
180
179
|
var _this2 = this;
|
|
@@ -236,5 +235,4 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
|
|
|
236
235
|
});
|
|
237
236
|
}
|
|
238
237
|
}]);
|
|
239
|
-
return PersistentStore;
|
|
240
238
|
}(_Store2["default"]);
|
package/dist/PubSub.js
CHANGED
|
@@ -12,8 +12,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
/*
|
|
18
18
|
* MIT License
|
|
19
19
|
*
|