This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Debounce creates a FUNCTION that when invoked, delays invoking fn for wait milliseconds since | |
* the last time it is called. | |
* | |
* @param {number} fn - function to call | |
* @param {number} wait - duration in milliseconds | |
* @param {number} maxWait - max duration in milliseconds before calling {@param fn} | |
* @retun {function} a function that will wait {@param wait} milliseconds since it's last called to invoke {@param fn}. | |
*/ | |
function debounce(fn, wait, maxWait=null) { |