The immensely useful lodash library comes with a debounce utility you can use for this.
https://lodash.com/docs/4.17.15#debounce
import { debounce } from 'lodash';
input.addEventListener('keyup', debounce(handleInputChange, 1000));
https://lodash.com/docs/4.17.15#debounce
import { debounce } from 'lodash';
input.addEventListener('keyup', debounce(handleInputChange, 1000));
No comments yet.