@devexperts/dxcharts-lite
Version:
13 lines (12 loc) • 470 B
JavaScript
/*
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
export const debounce = (callback, waitFor) => {
let timeout = 0;
return (...args) => {
clearTimeout(timeout);
timeout = +setTimeout(() => callback(...args), waitFor);
};
};