dataflux 1.19.3 → 1.19.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.
@@ -99,24 +99,32 @@ var ReactStore = exports["default"] = /*#__PURE__*/function (_ObserverStore) {
99
99
  // I know...
100
100
  (_context$___obs_subke = context.___obs_subkeys) !== null && _context$___obs_subke !== void 0 ? _context$___obs_subke : context.___obs_subkeys = [];
101
101
  context.___obs_subkeys.push(subKey);
102
- context.___obs_unsubscribe_context = _this;
103
- context.___obs_unsubscribe = function () {
104
- var _iterator = _createForOfIteratorHelper(context.___obs_subkeys || []),
105
- _step;
106
- try {
107
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
108
- var key = _step.value;
109
- context.___obs_unsubscribe_context.unsubscribe(key);
102
+ if (!context.___obs_unsubscribe_attached) {
103
+ context.___obs_unsubscribe_context = _this;
104
+ context.___obs_original_componentWillUnmount = context === null || context === void 0 ? void 0 : context.componentWillUnmount;
105
+ context.___obs_unsubscribe = function () {
106
+ var _iterator = _createForOfIteratorHelper(context.___obs_subkeys || []),
107
+ _step;
108
+ try {
109
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
110
+ var key = _step.value;
111
+ context.___obs_unsubscribe_context.unsubscribe(key);
112
+ }
113
+ } catch (err) {
114
+ _iterator.e(err);
115
+ } finally {
116
+ _iterator.f();
110
117
  }
111
- } catch (err) {
112
- _iterator.e(err);
113
- } finally {
114
- _iterator.f();
115
- }
116
- };
117
- context.componentWillUnmount = function () {
118
- context.___obs_unsubscribe();
119
- };
118
+ };
119
+ context.componentWillUnmount = function () {
120
+ context._isMounted = false;
121
+ context.___obs_unsubscribe();
122
+ if (context.___obs_original_componentWillUnmount) {
123
+ context.___obs_original_componentWillUnmount();
124
+ }
125
+ };
126
+ }
127
+ context.___obs_unsubscribe_attached = true;
120
128
  });
121
129
  _defineProperty(_this, "handleChange", function (object, name, cast) {
122
130
  return function (event, rawValue) {