dataflux 1.23.0 → 1.23.2

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.
@@ -144,7 +144,6 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
144
144
  key: "findAll",
145
145
  value: function findAll(type, stateAttribute, context, filterFunction) {
146
146
  _assertClassBrand(_ReactStore_brand, this, _fixState).call(this, stateAttribute, context, false);
147
- context._isMounted = true;
148
147
  var subKey = this.subscribe(type, function (data) {
149
148
  if (context._isMounted) {
150
149
  setTimeout(function () {
@@ -161,7 +160,6 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
161
160
  key: "findOne",
162
161
  value: function findOne(type, stateAttribute, context, filterFunction) {
163
162
  _assertClassBrand(_ReactStore_brand, this, _fixState).call(this, stateAttribute, context, true);
164
- context._isMounted = true;
165
163
  var subKey = this.subscribe(type, function (data) {
166
164
  if (context._isMounted) {
167
165
  setTimeout(context.setState(function (prev) {
@@ -175,7 +173,9 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
175
173
  }]);
176
174
  }(_ObserverStore2["default"]);
177
175
  function _fixState(stateAttribute, context, one) {
178
- if (!context[stateAttribute]) {
176
+ var _context$_isMounted;
177
+ (_context$_isMounted = context._isMounted) !== null && _context$_isMounted !== void 0 ? _context$_isMounted : context._isMounted = true;
178
+ if (context._isMounted && !context[stateAttribute]) {
179
179
  context[stateAttribute] = one ? null : []; // side effect on state
180
180
  }
181
181
  }