mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
12 lines
264 B
JavaScript
12 lines
264 B
JavaScript
import {DEBOUNCE_MILLIS} from 'backend/constants';
|
|
|
|
export function debounce (callback) {
|
|
let timeout = null;
|
|
return function () {
|
|
clearTimeout(timeout);
|
|
timeout = setTimeout(() => {
|
|
callback.apply(null, arguments)
|
|
}, DEBOUNCE_MILLIS);
|
|
}
|
|
}
|