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