@memberstack/dom 1.0.0-beta.14 → 1.0.0-beta.15

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.
Files changed (2) hide show
  1. package/lib/utils/proxy.js +10 -15
  2. package/package.json +1 -1
@@ -59,25 +59,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
59
59
  var persistence_1 = require("../auth/persistence");
60
60
  var handleResponse = function (fn, props) {
61
61
  return function () {
62
- var _a;
63
62
  var args = [];
64
63
  for (var _i = 0; _i < arguments.length; _i++) {
65
64
  args[_i] = arguments[_i];
66
65
  }
67
- var fun = fn.apply(void 0, __spread(args));
68
- if (fun.then) {
69
- return (_a = fun.then) === null || _a === void 0 ? void 0 : _a.call(fun, function (res) {
70
- var _a, _b, _c, _d;
71
- if ((_a = res.data) === null || _a === void 0 ? void 0 : _a.member) {
72
- persistence_1.setPersistedMember((_b = res.data) === null || _b === void 0 ? void 0 : _b.member, props.persistence);
73
- }
74
- if ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.startsWith("mem_")) {
75
- persistence_1.setPersistedMember(res.data, props.persistence);
76
- }
77
- return res;
78
- });
79
- }
80
- return fun;
66
+ return Promise.resolve(fn.apply(void 0, __spread(args))).then(function (res) {
67
+ var _a, _b, _c, _d;
68
+ if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.member) {
69
+ persistence_1.setPersistedMember((_b = res.data) === null || _b === void 0 ? void 0 : _b.member, props.persistence);
70
+ }
71
+ if ((_d = (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.startsWith("mem_")) {
72
+ persistence_1.setPersistedMember(res.data, props.persistence);
73
+ }
74
+ return res;
75
+ });
81
76
  };
82
77
  };
83
78
  var handler = function (props) { return ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberstack/dom",
3
- "version": "1.0.0-beta.14",
3
+ "version": "1.0.0-beta.15",
4
4
  "main": "./lib/index.js",
5
5
  "files": [
6
6
  "lib/**/*"