dataflux 1.5.4 → 1.5.5

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/BasicObj.js CHANGED
@@ -122,14 +122,16 @@ var BasicObj = /*#__PURE__*/_createClass(function BasicObj(values, model) {
122
122
  for (var _i = 0, _attrs = attrs; _i < _attrs.length; _i++) {
123
123
  var a = _attrs[_i];
124
124
 
125
- if (_this[a] instanceof _moment["default"]) {
125
+ if (_this[a] == null) {
126
+ out[a] = _this[a];
127
+ } else if (_this[a] instanceof _moment["default"]) {
126
128
  out[a] = _this[a].toISOString();
127
129
  } else if (_this[a] instanceof Date) {
128
130
  out[a] = (0, _moment["default"])(_this[a]).toISOString();
129
- } else if (_this[a].toJSON) {
131
+ } else if (_typeof(_this[a]) === "object" && _this[a].toJSON) {
130
132
  out[a] = _this[a].toJSON();
131
133
  } else if (Array.isArray(_this[a]) && _this[a].every(function (i) {
132
- return i.toJSON;
134
+ return _typeof(i) === "object" && i.toJSON;
133
135
  })) {
134
136
  out[a] = _this[a].map(function (i) {
135
137
  return i.toJSON();
@@ -9,8 +9,6 @@ exports["default"] = void 0;
9
9
 
10
10
  var _ObserverStore2 = _interopRequireDefault(require("./ObserverStore"));
11
11
 
12
- var _this = void 0;
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
13
 
16
14
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -64,8 +62,7 @@ var addSubscriptionToContext = function addSubscriptionToContext(context, subKey
64
62
  try {
65
63
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
66
64
  var key = _step.value;
67
-
68
- _this.unsubscribe(key);
65
+ context.unsubscribe(key);
69
66
  }
70
67
  } catch (err) {
71
68
  _iterator.e(err);
@@ -87,22 +84,22 @@ var ReactStore = /*#__PURE__*/function (_ObserverStore) {
87
84
  var _super = _createSuper(ReactStore);
88
85
 
89
86
  function ReactStore(options) {
90
- var _this2;
87
+ var _this;
91
88
 
92
89
  _classCallCheck(this, ReactStore);
93
90
 
94
- _this2 = _super.call(this, options);
91
+ _this = _super.call(this, options);
95
92
 
96
- _classPrivateMethodInitSpec(_assertThisInitialized(_this2), _fixState);
93
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _fixState);
97
94
 
98
- _defineProperty(_assertThisInitialized(_this2), "handleChange", function (object, name) {
95
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function (object, name) {
99
96
  return function (event, rawValue) {
100
97
  var value = event ? event.target.type === "checkbox" ? event.target.checked : event.target.value : "";
101
98
  object.set(name, value || rawValue || "");
102
99
  };
103
100
  });
104
101
 
105
- return _this2;
102
+ return _this;
106
103
  }
107
104
 
108
105
  _createClass(ReactStore, [{
@@ -22,14 +22,14 @@ var CRC32 = require('crc-32');
22
22
  var _getFingerprint = function _getFingerprint(object) {
23
23
  switch (_typeof(object)) {
24
24
  case "object":
25
- if (object._isAMomentObject) {
25
+ if (object == null) {
26
+ return "o:null";
27
+ } else if (object._isAMomentObject) {
26
28
  return "m:".concat(object.toISOString());
27
29
  } else if (object instanceof Date) {
28
30
  return "m:".concat((0, _moment["default"])(object).toISOString());
29
- } else if (object !== null) {
30
- return "o:".concat(getObjectFingerprint(object));
31
31
  } else {
32
- return "o:null";
32
+ return "o:".concat(getObjectFingerprint(object));
33
33
  }
34
34
 
35
35
  case "boolean":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataflux",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "DataFlux, automatically interfaces with your REST APIs to create a 2-way-synced local data store. Transparently manages data propagation in the React state.",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",