dataflux 1.19.1 → 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.
- package/dist/ReactStore.js +25 -17
- package/dist/Store.js +2 -2
- package/dist/dataflux.min.js +1 -1
- package/dist/dataflux.min.js.map +1 -1
- package/package.json +6 -6
package/dist/ReactStore.js
CHANGED
|
@@ -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.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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) {
|
package/dist/Store.js
CHANGED
|
@@ -155,7 +155,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
|
|
|
155
155
|
if (force) {
|
|
156
156
|
_classPrivateFieldGet(_wipe, _this).call(_this, currentObject.object);
|
|
157
157
|
_classPrivateFieldGet(_merge, _this).call(_this, currentObject.object, wrapper.toJSON());
|
|
158
|
-
currentObject.fingerprint =
|
|
158
|
+
currentObject.fingerprint = currentObject.object.getFingerprint();
|
|
159
159
|
updated.push(currentObject.object);
|
|
160
160
|
} else if (_this.hasChanged(type, currentObject.object)) {// Was the object edited locally?
|
|
161
161
|
|
|
@@ -163,7 +163,7 @@ var Store = exports["default"] = /*#__PURE__*/function () {
|
|
|
163
163
|
} else {
|
|
164
164
|
// Update with the new object
|
|
165
165
|
_classPrivateFieldGet(_merge, _this).call(_this, currentObject.object, wrapper.toJSON());
|
|
166
|
-
currentObject.fingerprint =
|
|
166
|
+
currentObject.fingerprint = currentObject.object.getFingerprint();
|
|
167
167
|
updated.push(currentObject.object);
|
|
168
168
|
}
|
|
169
169
|
}
|