https://karanktech.medium.com/throttling-and-debouncing-in-javascript-optimised-event-handling-fddcdde091d6