dataflux 1.4.4 → 1.4.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.
@@ -12,6 +12,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
12
12
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
13
 
14
14
  var getDataStringHook = function getDataStringHook(hook) {
15
+ var _hook$fields;
16
+
15
17
  var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
16
18
  var axios = arguments.length > 2 ? arguments[2] : undefined;
17
19
  var options = {
@@ -25,7 +27,7 @@ var getDataStringHook = function getDataStringHook(hook) {
25
27
  options.headers = hook.headers;
26
28
  }
27
29
 
28
- if (hook.fields) {
30
+ if (hook !== null && hook !== void 0 && (_hook$fields = hook.fields) !== null && _hook$fields !== void 0 && _hook$fields.length) {
29
31
  setFields(options, hook);
30
32
  }
31
33
 
@@ -55,7 +57,9 @@ var createHookItem = function createHookItem(optionItem, defaultMethod, defaultU
55
57
  } else {
56
58
  return {
57
59
  method: defaultMethod,
58
- url: defaultUrl
60
+ url: defaultUrl,
61
+ fields: options.fields || [],
62
+ headers: options.headers || {}
59
63
  };
60
64
  }
61
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataflux",
3
- "version": "1.4.4",
3
+ "version": "1.4.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",