UNPKG

@yandex/ui

Version:

Yandex UI components

11 lines (10 loc) 597 B
import { __assign, __rest } from "tslib"; import React from 'react'; import { DebounceInput } from 'react-debounce-input'; var noop = function () { return null; }; export var withDebounceInput = function (Input) { return function (_a) { var _b = _a.onChange, onChange = _b === void 0 ? noop : _b, _c = _a.debounceTimeout, debounceTimeout = _c === void 0 ? 0 : _c, props = __rest(_a, ["onChange", "debounceTimeout"]); return (React.createElement(DebounceInput, __assign({ element: Input }, __assign({ onChange: onChange, debounceTimeout: debounceTimeout }, props)))); }; };