@lowentry/react-redux 1.10.6 → 1.11.1

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.
@@ -0,0 +1,107 @@
1
+ export namespace LeRed {
2
+ function set(key: any, value: any): void;
3
+ function setAll(obj: any, optionalSkipHasOwnPropertyCheck?: boolean): void;
4
+ function configureStore(storeData: any): any;
5
+ function createAction(id: any): RTK.ActionCreatorWithoutPayload<string>;
6
+ function createSelector(selectorsGenerator: any): (stateOfSlice: any) => any;
7
+ function createCachedSelector(selectorsGenerator: any, equalsComparator: any): ((stateOfSlice: any) => any) | undefined;
8
+ function createSlice(slice: any): any;
9
+ function createFastSlice(slice: any): any;
10
+ function current(obj: any): any;
11
+ function useConfigureStore(storeData: any): any;
12
+ function useSelector(selector: any, equalsComparator: any): unknown;
13
+ function useEffect(callable: any, comparingValues: any, equalsComparator: any): any;
14
+ function useEffectInterval(callable: any, comparingValues: any, intervalMs: any, fireImmediately: any, equalsComparator: any): any;
15
+ function useEffectAnimationFrameInterval(callable: any, comparingValues: any, intervalFrames: any, fireImmediately: any, equalsComparator: any): any;
16
+ function useEffectGenerator(callable: any, comparingValues: any, intervalMs: any, fireImmediately: any, equalsComparator: any): any;
17
+ function useEffectGeneratorLoop(callable: any, comparingValues: any, intervalMs: any, fireImmediately: any, equalsComparator: any): any;
18
+ function useEffectShutdown(callable: any, comparingValues: any, equalsComparator: any): any;
19
+ function useEffectPageFocusLost(callable: any, comparingValues: any, equalsComparator: any): any;
20
+ function memo(component: any, equalsComparator: any): any;
21
+ function useMemo(callable: any, comparingValues: any, equalsComparator: any): any;
22
+ function useCallback(callable: any, comparingValues: any, equalsComparator: any): any;
23
+ function usePrevious(value: any, initialValue: any): any;
24
+ function useFont(font: any): any;
25
+ /**
26
+ * Adds a <script> tag to the <head> of the document.
27
+ * Only for development and testing purposes.
28
+ *
29
+ * @param {string} url The URL of the js file to include.
30
+ * @param {object} props Additional props of the <script> tag.
31
+ */
32
+ function useScript(url: string, props?: object): any;
33
+ function mergeRefs(...refs: any[]): any;
34
+ function useTriggerable(event: any): any;
35
+ function trigger(event: any, value: any): void;
36
+ /**
37
+ * A useState() hook that automatically resets to the defaultValue after the given duration.
38
+ *
39
+ * Example:
40
+ *
41
+ * ```js
42
+ * const [value, setValue] = LeRed.useTempState(true, 2000);
43
+ * // somewhere in your code:
44
+ * setValue(false); // value is now false, after 2 seconds it will be reset to true
45
+ * ```
46
+ *
47
+ * Repeated calls cause the timer to reset, meaning each set value will always remain for the full given duration.
48
+ */
49
+ function useTempState(defaultValue: any, duration: any): any[];
50
+ function useHistory(onForward: any, onBack: any): (() => void)[];
51
+ /**
52
+ * Similar to {@link LeRed.useHistory}, but this is specifically for toggling a boolean state between true and false. For example, for a modal, which you'd like to be closed when the user goes back in history.
53
+ *
54
+ * Example:
55
+ *
56
+ * ```js
57
+ * const [isModalOpen, openModal, closeModal] = LeRed.useHistoryState(false); // you'd open it programmatically using openModal(), afterwards, if the user goes back in history, it will close again
58
+ * ```
59
+ *
60
+ * or, if you'd like it to be true by default:
61
+ *
62
+ * ```js
63
+ * const [isModalOpen, openModal, closeModal] = LeRed.useHistoryState(true); // you'd close it programmatically using closeModal(), afterwards, if the user goes back in history, it will open again
64
+ * ```
65
+ */
66
+ function useHistoryState(initialState: any): any[];
67
+ /**
68
+ * Allows you to easily create an <pre><img></pre> url and onError handler that will automatically retry loading the image if it fails.
69
+ */
70
+ function useRetryingImageUrl(url: any, options: any): any[];
71
+ /**
72
+ * Allows you to easily convert promises to react hooks.
73
+ *
74
+ * The given callable should return promises. The returned promises can be an array, an object, or even a single promise. The returned data of this hook will match the promises it has operated on.
75
+ *
76
+ * The given comparingValues can be anything, this is used to detect whether the given promises have changed or not, and so whether new promises have to be generated and executed again.
77
+ */
78
+ function usePromises(callable: any, comparingValues: any): any[];
79
+ /**
80
+ * Allows you to easily obtain external data.
81
+ */
82
+ function useExternal(url: any, options: any, responseFunction: any): any[];
83
+ /**
84
+ * Allows you to easily obtain external JSON data.
85
+ */
86
+ function useExternalJson(url: any, options: any): any[];
87
+ /**
88
+ * Allows you to easily obtain external Blob data.
89
+ */
90
+ function useExternalBlob(url: any, options: any): any[];
91
+ /**
92
+ * Allows you to easily obtain external ArrayBuffer data.
93
+ */
94
+ function useExternalArrayBuffer(url: any, options: any): any[];
95
+ /**
96
+ * Allows you to easily obtain external string data.
97
+ */
98
+ function useExternalString(url: any, options: any): any[];
99
+ /**
100
+ * Allows you to easily obtain external form data.
101
+ */
102
+ function useExternalFormData(url: any, options: any): any[];
103
+ let Root: any;
104
+ function PreloadComponent(load: any): any;
105
+ let LoadComponent: any;
106
+ }
107
+ import * as RTK from '@reduxjs/toolkit';
@@ -0,0 +1 @@
1
+ export { LeRed } from "./LeRed.jsx";
package/index.js CHANGED
@@ -71,10 +71,10 @@ var LeRed = function () {
71
71
  LeRed.effects.delayFrames = function () {
72
72
  var frames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
73
73
  return /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
74
- return _regeneratorRuntime.wrap(function _callee$(_context) {
74
+ return _regeneratorRuntime.wrap(function (_context) {
75
75
  while (1) switch (_context.prev = _context.next) {
76
76
  case 0:
77
- _context.next = 2;
77
+ _context.next = 1;
78
78
  return LeRed.effects.call(function () {
79
79
  return new Promise(function (resolve, reject) {
80
80
  try {
@@ -84,7 +84,7 @@ var LeRed = function () {
84
84
  }
85
85
  });
86
86
  });
87
- case 2:
87
+ case 1:
88
88
  case "end":
89
89
  return _context.stop();
90
90
  }
@@ -92,8 +92,8 @@ var LeRed = function () {
92
92
  })();
93
93
  };
94
94
  LeRed.effects.interval = /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(callback, intervalMs) {
95
- var channel, stop;
96
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
95
+ var channel, stop, _t, _t2;
96
+ return _regeneratorRuntime.wrap(function (_context2) {
97
97
  while (1) switch (_context2.prev = _context2.next) {
98
98
  case 0:
99
99
  channel = LeRed.eventChannel(function (emitter) {
@@ -114,53 +114,53 @@ var LeRed = function () {
114
114
  console.error(e);
115
115
  }
116
116
  };
117
- case 2:
117
+ case 1:
118
118
  if (!(channel !== null)) {
119
- _context2.next = 28;
119
+ _context2.next = 13;
120
120
  break;
121
121
  }
122
- _context2.prev = 3;
123
- _context2.next = 6;
122
+ _context2.prev = 2;
123
+ _context2.next = 3;
124
124
  return LeRed.effects.take(channel);
125
- case 6:
126
- _context2.next = 8;
125
+ case 3:
126
+ _context2.next = 4;
127
127
  return callback(stop);
128
- case 8:
129
- _context2.next = 13;
128
+ case 4:
129
+ _context2.next = 6;
130
130
  break;
131
- case 10:
132
- _context2.prev = 10;
133
- _context2.t0 = _context2["catch"](3);
134
- console.error(_context2.t0);
135
- case 13:
136
- _context2.prev = 13;
137
- _context2.prev = 14;
138
- _context2.next = 17;
131
+ case 5:
132
+ _context2.prev = 5;
133
+ _t = _context2["catch"](2);
134
+ console.error(_t);
135
+ case 6:
136
+ _context2.prev = 6;
137
+ _context2.prev = 7;
138
+ _context2.next = 8;
139
139
  return LeRed.effects.cancelled();
140
- case 17:
140
+ case 8:
141
141
  if (!_context2.sent) {
142
- _context2.next = 20;
142
+ _context2.next = 9;
143
143
  break;
144
144
  }
145
145
  channel.close();
146
146
  channel = null;
147
- case 20:
148
- _context2.next = 25;
147
+ case 9:
148
+ _context2.next = 11;
149
149
  break;
150
- case 22:
151
- _context2.prev = 22;
152
- _context2.t1 = _context2["catch"](14);
153
- console.error(_context2.t1);
154
- case 25:
155
- return _context2.finish(13);
156
- case 26:
157
- _context2.next = 2;
150
+ case 10:
151
+ _context2.prev = 10;
152
+ _t2 = _context2["catch"](7);
153
+ console.error(_t2);
154
+ case 11:
155
+ return _context2.finish(6);
156
+ case 12:
157
+ _context2.next = 1;
158
158
  break;
159
- case 28:
159
+ case 13:
160
160
  case "end":
161
161
  return _context2.stop();
162
162
  }
163
- }, _callee2, null, [[3, 10, 13, 26], [14, 22]]);
163
+ }, _callee2, null, [[2, 5, 6, 12], [7, 10]]);
164
164
  });
165
165
  } catch (e) {
166
166
  console.error(e);
@@ -238,6 +238,8 @@ var LeRed = function () {
238
238
  });
239
239
  });
240
240
  });
241
+
242
+ /** @type {object|*} */
241
243
  var reducers = {};
242
244
  LeUtils.each(reducerArrays, function (reducerArray, reducerName) {
243
245
  reducerArray = LeUtils.flattenArray(reducerArray);
@@ -283,6 +285,8 @@ var LeRed = function () {
283
285
  var _getDefaultMiddleware;
284
286
  return (_getDefaultMiddleware = getDefaultMiddleware()).concat.apply(_getDefaultMiddleware, _toConsumableArray(middleware));
285
287
  };
288
+
289
+ /** @type {RTK.EnhancedStore|*} */
286
290
  var store = RTK.configureStore(storeData);
287
291
  store.__lowentry_store__ = true;
288
292
  store.state = function () {
@@ -305,12 +309,12 @@ var LeRed = function () {
305
309
  };
306
310
  if (sagaMiddleware !== null) {
307
311
  sagaMiddleware.run(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
308
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
312
+ return _regeneratorRuntime.wrap(function (_context3) {
309
313
  while (1) switch (_context3.prev = _context3.next) {
310
314
  case 0:
311
- _context3.next = 2;
315
+ _context3.next = 1;
312
316
  return ReduxSagaEffects.all(sagaListeners);
313
- case 2:
317
+ case 1:
314
318
  case "end":
315
319
  return _context3.stop();
316
320
  }
@@ -394,18 +398,20 @@ var LeRed = function () {
394
398
  LeUtils.each(LeUtils.flattenArray(reducer), function (reducer) {
395
399
  if (LeUtils.isGeneratorFunction(reducer)) {
396
400
  var sagaListener = /*#__PURE__*/_regeneratorRuntime.mark(function sagaListener() {
397
- return _regeneratorRuntime.wrap(function sagaListener$(_context5) {
401
+ return _regeneratorRuntime.wrap(function (_context5) {
398
402
  while (1) switch (_context5.prev = _context5.next) {
399
403
  case 0:
400
- _context5.next = 2;
401
- return ReduxSagaEffects.takeEvery(reducerAction, /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(action) {
402
- var promiseResolve, promiseReject, promise, result;
403
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
404
+ _context5.next = 1;
405
+ return ReduxSagaEffects.takeEvery(reducerAction, /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(/** @type {RTK.Action|*} */action) {
406
+ var promiseResolve, promiseReject, promise, result, _t3;
407
+ return _regeneratorRuntime.wrap(function (_context4) {
404
408
  while (1) switch (_context4.prev = _context4.next) {
405
409
  case 0:
410
+ /** @type {((value:*)=>void)|null|*} */
406
411
  promiseResolve = null;
412
+ /** @type {((reason:*)=>void)|null|*} */
407
413
  promiseReject = null;
408
- _context4.prev = 2;
414
+ _context4.prev = 1;
409
415
  if (action.__lowentry_dispatch__ === true) {
410
416
  promise = new Promise(function (resolve, reject) {
411
417
  promiseResolve = resolve;
@@ -419,34 +425,34 @@ var LeRed = function () {
419
425
  action.__lowentry_dispatch_result__ = promise;
420
426
  }
421
427
  }
422
- _context4.next = 6;
428
+ _context4.next = 2;
423
429
  return reducer.apply(slice, [action.payload]);
424
- case 6:
430
+ case 2:
425
431
  result = _context4.sent;
426
432
  if (promiseResolve !== null) {
427
433
  promiseResolve(result);
428
434
  }
429
- _context4.next = 15;
435
+ _context4.next = 4;
430
436
  break;
431
- case 10:
432
- _context4.prev = 10;
433
- _context4.t0 = _context4["catch"](2);
437
+ case 3:
438
+ _context4.prev = 3;
439
+ _t3 = _context4["catch"](1);
434
440
  console.error('an error was thrown by your LeRed.createSlice(...) code, by slice "' + slice.name + '", action "' + reducerName + '":');
435
- console.error(_context4.t0);
441
+ console.error(_t3);
436
442
  if (promiseReject !== null) {
437
443
  try {
438
- promiseReject(_context4.t0);
444
+ promiseReject(_t3);
439
445
  } catch (e2) {
440
446
  console.error(e2);
441
447
  }
442
448
  }
443
- case 15:
449
+ case 4:
444
450
  case "end":
445
451
  return _context4.stop();
446
452
  }
447
- }, _callee4, null, [[2, 10]]);
453
+ }, _callee4, null, [[1, 3]]);
448
454
  }));
449
- case 2:
455
+ case 1:
450
456
  case "end":
451
457
  return _context5.stop();
452
458
  }
@@ -618,52 +624,52 @@ var LeRed = function () {
618
624
  return LeRed.useEffect(function () {
619
625
  var stop = false;
620
626
  _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
621
- var _iterator, _step, promise;
622
- return _regeneratorRuntime.wrap(function _callee5$(_context6) {
627
+ var _iterator, _step, promise, _t4;
628
+ return _regeneratorRuntime.wrap(function (_context6) {
623
629
  while (1) switch (_context6.prev = _context6.next) {
624
630
  case 0:
625
631
  _iterator = _createForOfIteratorHelper(callable());
626
632
  _context6.prev = 1;
627
633
  _iterator.s();
628
- case 3:
634
+ case 2:
629
635
  if ((_step = _iterator.n()).done) {
630
- _context6.next = 13;
636
+ _context6.next = 6;
631
637
  break;
632
638
  }
633
639
  promise = _step.value;
634
640
  if (!stop) {
635
- _context6.next = 7;
641
+ _context6.next = 3;
636
642
  break;
637
643
  }
638
644
  return _context6.abrupt("return");
639
- case 7:
640
- _context6.next = 9;
645
+ case 3:
646
+ _context6.next = 4;
641
647
  return promise;
642
- case 9:
648
+ case 4:
643
649
  if (!stop) {
644
- _context6.next = 11;
650
+ _context6.next = 5;
645
651
  break;
646
652
  }
647
653
  return _context6.abrupt("return");
648
- case 11:
649
- _context6.next = 3;
654
+ case 5:
655
+ _context6.next = 2;
650
656
  break;
651
- case 13:
652
- _context6.next = 18;
657
+ case 6:
658
+ _context6.next = 8;
653
659
  break;
654
- case 15:
655
- _context6.prev = 15;
656
- _context6.t0 = _context6["catch"](1);
657
- _iterator.e(_context6.t0);
658
- case 18:
659
- _context6.prev = 18;
660
+ case 7:
661
+ _context6.prev = 7;
662
+ _t4 = _context6["catch"](1);
663
+ _iterator.e(_t4);
664
+ case 8:
665
+ _context6.prev = 8;
660
666
  _iterator.f();
661
- return _context6.finish(18);
662
- case 21:
667
+ return _context6.finish(8);
668
+ case 9:
663
669
  case "end":
664
670
  return _context6.stop();
665
671
  }
666
- }, _callee5, null, [[1, 15, 18, 21]]);
672
+ }, _callee5, null, [[1, 7, 8, 9]]);
667
673
  }))();
668
674
  return function () {
669
675
  stop = true;
@@ -674,59 +680,59 @@ var LeRed = function () {
674
680
  return LeRed.useEffect(function () {
675
681
  var stop = false;
676
682
  _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
677
- var _iterator2, _step2, promise;
678
- return _regeneratorRuntime.wrap(function _callee6$(_context7) {
683
+ var _iterator2, _step2, promise, _t5;
684
+ return _regeneratorRuntime.wrap(function (_context7) {
679
685
  while (1) switch (_context7.prev = _context7.next) {
680
686
  case 0:
681
687
  if (stop) {
682
- _context7.next = 24;
688
+ _context7.next = 10;
683
689
  break;
684
690
  }
685
691
  _iterator2 = _createForOfIteratorHelper(callable());
686
- _context7.prev = 2;
692
+ _context7.prev = 1;
687
693
  _iterator2.s();
688
- case 4:
694
+ case 2:
689
695
  if ((_step2 = _iterator2.n()).done) {
690
- _context7.next = 14;
696
+ _context7.next = 6;
691
697
  break;
692
698
  }
693
699
  promise = _step2.value;
694
700
  if (!stop) {
695
- _context7.next = 8;
701
+ _context7.next = 3;
696
702
  break;
697
703
  }
698
704
  return _context7.abrupt("return");
699
- case 8:
700
- _context7.next = 10;
705
+ case 3:
706
+ _context7.next = 4;
701
707
  return promise;
702
- case 10:
708
+ case 4:
703
709
  if (!stop) {
704
- _context7.next = 12;
710
+ _context7.next = 5;
705
711
  break;
706
712
  }
707
713
  return _context7.abrupt("return");
708
- case 12:
709
- _context7.next = 4;
714
+ case 5:
715
+ _context7.next = 2;
710
716
  break;
711
- case 14:
712
- _context7.next = 19;
717
+ case 6:
718
+ _context7.next = 8;
713
719
  break;
714
- case 16:
715
- _context7.prev = 16;
716
- _context7.t0 = _context7["catch"](2);
717
- _iterator2.e(_context7.t0);
718
- case 19:
719
- _context7.prev = 19;
720
+ case 7:
721
+ _context7.prev = 7;
722
+ _t5 = _context7["catch"](1);
723
+ _iterator2.e(_t5);
724
+ case 8:
725
+ _context7.prev = 8;
720
726
  _iterator2.f();
721
- return _context7.finish(19);
722
- case 22:
727
+ return _context7.finish(8);
728
+ case 9:
723
729
  _context7.next = 0;
724
730
  break;
725
- case 24:
731
+ case 10:
726
732
  case "end":
727
733
  return _context7.stop();
728
734
  }
729
- }, _callee6, null, [[2, 16, 19, 22]]);
735
+ }, _callee6, null, [[1, 7, 8, 9]]);
730
736
  }))();
731
737
  return function () {
732
738
  stop = true;
@@ -922,7 +928,7 @@ var LeRed = function () {
922
928
  return function () {
923
929
  return window.removeEventListener(eventName, callback);
924
930
  };
925
- }, []);
931
+ }, [event]);
926
932
  return value;
927
933
  };
928
934
  LeRed.trigger = function (event, value) {
@@ -1078,9 +1084,9 @@ var LeRed = function () {
1078
1084
  url = STRING(url);
1079
1085
  var urlHasQ = url.includes('?');
1080
1086
  var _LeRed$useState9 = LeRed.useState(url),
1081
- _LeRed$useState10 = _slicedToArray(_LeRed$useState9, 2),
1082
- imageUrl = _LeRed$useState10[0],
1083
- setImageUrl = _LeRed$useState10[1];
1087
+ _LeRed$useState0 = _slicedToArray(_LeRed$useState9, 2),
1088
+ imageUrl = _LeRed$useState0[0],
1089
+ setImageUrl = _LeRed$useState0[1];
1084
1090
  var retries = LeRed.useRef(0);
1085
1091
  var timeout = LeRed.useRef({
1086
1092
  remove: function remove() {
@@ -1120,18 +1126,18 @@ var LeRed = function () {
1120
1126
  var comparingValuesRef = LeRed.useRef(comparingValuesClone);
1121
1127
  var latestComparingValuesRef = LeRed.useRef();
1122
1128
  latestComparingValuesRef.current = comparingValuesClone;
1123
- var _LeRed$useState11 = LeRed.useState(null),
1129
+ var _LeRed$useState1 = LeRed.useState(null),
1130
+ _LeRed$useState10 = _slicedToArray(_LeRed$useState1, 2),
1131
+ data = _LeRed$useState10[0],
1132
+ setData = _LeRed$useState10[1];
1133
+ var _LeRed$useState11 = LeRed.useState(true),
1124
1134
  _LeRed$useState12 = _slicedToArray(_LeRed$useState11, 2),
1125
- data = _LeRed$useState12[0],
1126
- setData = _LeRed$useState12[1];
1127
- var _LeRed$useState13 = LeRed.useState(true),
1135
+ loading = _LeRed$useState12[0],
1136
+ setLoading = _LeRed$useState12[1];
1137
+ var _LeRed$useState13 = LeRed.useState(null),
1128
1138
  _LeRed$useState14 = _slicedToArray(_LeRed$useState13, 2),
1129
- loading = _LeRed$useState14[0],
1130
- setLoading = _LeRed$useState14[1];
1131
- var _LeRed$useState15 = LeRed.useState(null),
1132
- _LeRed$useState16 = _slicedToArray(_LeRed$useState15, 2),
1133
- error = _LeRed$useState16[0],
1134
- setError = _LeRed$useState16[1];
1139
+ error = _LeRed$useState14[0],
1140
+ setError = _LeRed$useState14[1];
1135
1141
  LeRed.useEffect(function () {
1136
1142
  setLoading(true);
1137
1143
  setData(null);
@@ -1160,7 +1166,7 @@ var LeRed = function () {
1160
1166
  key = _ref3.key;
1161
1167
  wrappedPromises.push(promise.then(/*#__PURE__*/function () {
1162
1168
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(result) {
1163
- return _regeneratorRuntime.wrap(function _callee7$(_context8) {
1169
+ return _regeneratorRuntime.wrap(function (_context8) {
1164
1170
  while (1) switch (_context8.prev = _context8.next) {
1165
1171
  case 0:
1166
1172
  return _context8.abrupt("return", {
@@ -1263,22 +1269,22 @@ var LeRed = function () {
1263
1269
  }, options !== null && options !== void 0 ? options : {})).then(/*#__PURE__*/function () {
1264
1270
  var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(response) {
1265
1271
  var data;
1266
- return _regeneratorRuntime.wrap(function _callee8$(_context9) {
1272
+ return _regeneratorRuntime.wrap(function (_context9) {
1267
1273
  while (1) switch (_context9.prev = _context9.next) {
1268
1274
  case 0:
1269
- _context9.next = 2;
1275
+ _context9.next = 1;
1270
1276
  return responseFunction(response);
1271
- case 2:
1277
+ case 1:
1272
1278
  data = _context9.sent;
1273
1279
  if (!(typeof (options === null || options === void 0 ? void 0 : options.verify) === 'function')) {
1274
- _context9.next = 6;
1280
+ _context9.next = 2;
1275
1281
  break;
1276
1282
  }
1277
- _context9.next = 6;
1283
+ _context9.next = 2;
1278
1284
  return options.verify(data, response);
1279
- case 6:
1285
+ case 2:
1280
1286
  return _context9.abrupt("return", data);
1281
- case 7:
1287
+ case 3:
1282
1288
  case "end":
1283
1289
  return _context9.stop();
1284
1290
  }
@@ -1381,44 +1387,44 @@ var LeRed = function () {
1381
1387
  var loading = _ref9.loading,
1382
1388
  load = _ref9.load,
1383
1389
  other = _objectWithoutProperties(_ref9, _excluded2);
1384
- var _LeRed$useState17 = LeRed.useState(loading !== null && loading !== void 0 ? loading : null),
1385
- _LeRed$useState18 = _slicedToArray(_LeRed$useState17, 2),
1386
- Component = _LeRed$useState18[0],
1387
- setComponent = _LeRed$useState18[1];
1390
+ var _LeRed$useState15 = LeRed.useState(loading !== null && loading !== void 0 ? loading : null),
1391
+ _LeRed$useState16 = _slicedToArray(_LeRed$useState15, 2),
1392
+ Component = _LeRed$useState16[0],
1393
+ setComponent = _LeRed$useState16[1];
1388
1394
  LeRed.useEffect(function () {
1389
1395
  _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
1390
- var LoadedComponent;
1391
- return _regeneratorRuntime.wrap(function _callee9$(_context10) {
1392
- while (1) switch (_context10.prev = _context10.next) {
1396
+ var LoadedComponent, _t6;
1397
+ return _regeneratorRuntime.wrap(function (_context0) {
1398
+ while (1) switch (_context0.prev = _context0.next) {
1393
1399
  case 0:
1394
1400
  if (!(typeof load === 'function')) {
1395
- _context10.next = 6;
1401
+ _context0.next = 2;
1396
1402
  break;
1397
1403
  }
1398
- _context10.next = 3;
1404
+ _context0.next = 1;
1399
1405
  return load();
1400
- case 3:
1401
- _context10.t0 = _context10.sent;
1402
- _context10.next = 9;
1406
+ case 1:
1407
+ _t6 = _context0.sent;
1408
+ _context0.next = 4;
1403
1409
  break;
1404
- case 6:
1405
- _context10.next = 8;
1410
+ case 2:
1411
+ _context0.next = 3;
1406
1412
  return load;
1407
- case 8:
1408
- _context10.t0 = _context10.sent;
1409
- case 9:
1410
- LoadedComponent = _context10.t0;
1413
+ case 3:
1414
+ _t6 = _context0.sent;
1415
+ case 4:
1416
+ LoadedComponent = _t6;
1411
1417
  if (LoadedComponent) {
1412
- _context10.next = 13;
1418
+ _context0.next = 5;
1413
1419
  break;
1414
1420
  }
1415
1421
  setComponent(null);
1416
- return _context10.abrupt("return");
1417
- case 13:
1422
+ return _context0.abrupt("return");
1423
+ case 5:
1418
1424
  setComponent(/*#__PURE__*/React.createElement(LoadedComponent, other));
1419
- case 14:
1425
+ case 6:
1420
1426
  case "end":
1421
- return _context10.stop();
1427
+ return _context0.stop();
1422
1428
  }
1423
1429
  }, _callee9);
1424
1430
  }))();