react-native-a11y
Version:
Improvements of a11y for ReactNative, this library improve work with reader and keyboard focus and reader in general.
23 lines (22 loc) • 671 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debounce = void 0;
const debounce = function (callback) {
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
let timer;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (timer) {
clearTimeout(timer);
timer = null;
}
timer = setTimeout(() => callback(args), timeout);
};
};
exports.debounce = debounce;
//# sourceMappingURL=debounce.js.map
;