@devexperts/dxcharts-lite
Version:
18 lines (17 loc) • 738 B
JavaScript
/*
* Copyright (C) 2019 - 2026 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/.
*/
/*
* Copyright (C) 2019 - 2024 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);
};
};