dataflux 1.23.2 → 1.23.3
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/Store.js +7 -5
- package/dist/dataflux.min.js +1 -1
- package/dist/dataflux.min.js.map +1 -1
- package/package.json +1 -1
package/dist/Store.js
CHANGED
|
@@ -306,11 +306,9 @@ var Store = exports["default"] = /*#__PURE__*/function () {
|
|
|
306
306
|
key: "delete",
|
|
307
307
|
value: function _delete(typeOrObjects, filterFunction) {
|
|
308
308
|
if (typeof typeOrObjects === "string" && typeof filterFunction === "function") {
|
|
309
|
-
|
|
310
|
-
return _assertClassBrand(_Store_brand, this, _deleteByFilter).call(this, type, filterFunction);
|
|
309
|
+
return _assertClassBrand(_Store_brand, this, _deleteByFilter).call(this, typeOrObjects, filterFunction);
|
|
311
310
|
} else if (Array.isArray(typeOrObjects) && typeOrObjects.length && !filterFunction) {
|
|
312
|
-
|
|
313
|
-
return Promise.all(objects.map(_classPrivateFieldGet(_deleteByObject, this))).then(function (data) {
|
|
311
|
+
return Promise.all(typeOrObjects.map(_classPrivateFieldGet(_deleteByObject, this))).then(function (data) {
|
|
314
312
|
return data.flat();
|
|
315
313
|
});
|
|
316
314
|
} else {
|
|
@@ -537,7 +535,11 @@ function _deleteByFilter(type, filterFunction) {
|
|
|
537
535
|
try {
|
|
538
536
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
539
537
|
var object = _step6.value;
|
|
540
|
-
object.status
|
|
538
|
+
if (object.status === "new") {
|
|
539
|
+
delete _this11.models[type].storedObjects[object.getId()];
|
|
540
|
+
} else {
|
|
541
|
+
object.status = "deleted";
|
|
542
|
+
}
|
|
541
543
|
}
|
|
542
544
|
} catch (err) {
|
|
543
545
|
_iterator6.e(err);
|