dataflux 1.24.3 → 1.24.4
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/ObserverStore.js
CHANGED
|
@@ -35,7 +35,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
35
35
|
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); }
|
|
36
36
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
37
37
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
38
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
39
38
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
40
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"); } /*
|
|
41
40
|
* MIT License
|
|
@@ -119,7 +118,7 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
119
118
|
return subKey;
|
|
120
119
|
});
|
|
121
120
|
_defineProperty(_this, "unsubscribe", function (key) {
|
|
122
|
-
|
|
121
|
+
var prom = (_classPrivateFieldGet(_queryPromises, _this).length ? Promise.all(_classPrivateFieldGet(_queryPromises, _this)) : Promise.resolve()).then(function () {
|
|
123
122
|
if (_this._multipleSubscribed[key]) {
|
|
124
123
|
var _iterator = _createForOfIteratorHelper(_this._multipleSubscribed[key]),
|
|
125
124
|
_step;
|
|
@@ -151,7 +150,11 @@ var ObserverStore = /*#__PURE__*/function (_PersistentStore) {
|
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
|
-
}))
|
|
153
|
+
})["finally"](function () {
|
|
154
|
+
var idx = _classPrivateFieldGet(_unsubPromises, _this).indexOf(prom);
|
|
155
|
+
if (idx !== -1) _classPrivateFieldGet(_unsubPromises, _this).splice(idx, 1);
|
|
156
|
+
});
|
|
157
|
+
_classPrivateFieldGet(_unsubPromises, _this).push(prom);
|
|
155
158
|
});
|
|
156
159
|
_classPrivateFieldInitSpec(_this, _getUniqueSubs, function (objects, type) {
|
|
157
160
|
var out = {};
|