dataflux 1.20.0 → 1.21.0

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.
@@ -71,7 +71,6 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
71
71
  _defineProperty(_this, "_save", function () {
72
72
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
73
73
  _this._busy = true;
74
- _this.pubSub.publish("save", "start");
75
74
  if (_this._delayedSaveTimer) {
76
75
  clearTimeout(_this._delayedSaveTimer);
77
76
  }
@@ -82,11 +81,9 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
82
81
  return _this._saveByType(i, true);
83
82
  })).then(function (data) {
84
83
  _this._busy = false;
85
- _this.pubSub.publish("save", "end");
86
84
  return data;
87
85
  })["catch"](function (error) {
88
86
  _this._busy = false;
89
- _this.pubSub.publish("save", "end");
90
87
  _this.pubSub.publish("error", error);
91
88
  return Promise.reject(error);
92
89
  });
@@ -137,8 +134,18 @@ var PersistentStore = exports["default"] = /*#__PURE__*/function (_Store) {
137
134
  });
138
135
  });
139
136
  _defineProperty(_this, "_saveByType", function (type, ifLoaded) {
137
+ _this.pubSub.publish("save", {
138
+ status: "start",
139
+ model: type
140
+ });
140
141
  return _this.getDiff(type, ifLoaded).then(function (diff) {
141
142
  return _this._saveDiff(type, diff);
143
+ }).then(function (data) {
144
+ _this.pubSub.publish("save", {
145
+ status: "end",
146
+ model: type
147
+ });
148
+ return data;
142
149
  });
143
150
  });
144
151
  _defineProperty(_this, "delayedSave", function () {