indicator-ui 0.0.339 → 0.0.340

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/index.js CHANGED
@@ -41554,32 +41554,27 @@ __webpack_require__.r(__webpack_exports__);
41554
41554
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
41555
41555
 
41556
41556
 
41557
- function useDebouncedInvoker(callback) {
41557
+ function useDebouncedInvoker() {
41558
+ var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
41559
+ return undefined;
41560
+ };
41558
41561
  var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
41559
41562
  var callbackRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(callback);
41560
41563
  callbackRef.current = callback;
41561
- var debouncedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
41562
- // Инициализация и обновление debounce
41564
+ var debouncedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
41563
41565
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
41564
41566
  debouncedRef.current = lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(function () {
41565
- // Добавляем проверку перед вызовом
41566
- if (typeof callbackRef.current === "function") {
41567
- return callbackRef.current.apply(callbackRef, arguments);
41568
- }
41567
+ callbackRef.current();
41569
41568
  }, delay);
41570
41569
  return function () {
41571
41570
  var _debouncedRef$current;
41572
41571
  (_debouncedRef$current = debouncedRef.current) === null || _debouncedRef$current === void 0 || _debouncedRef$current.cancel();
41573
- debouncedRef.current = null;
41574
41572
  };
41575
41573
  }, [delay]);
41574
+ // Возвращаем вызываемую функцию
41576
41575
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
41577
- if (debouncedRef.current) {
41578
- return debouncedRef.current.apply(debouncedRef, arguments);
41579
- }
41580
- if (typeof callbackRef.current === "function") {
41581
- return callbackRef.current.apply(callbackRef, arguments);
41582
- }
41576
+ var _debouncedRef$current2;
41577
+ (_debouncedRef$current2 = debouncedRef.current) === null || _debouncedRef$current2 === void 0 || _debouncedRef$current2.call(debouncedRef);
41583
41578
  }, []);
41584
41579
  }
41585
41580