UNPKG

mini-debounce

Version:

Extremely small and modern debounce library (smaller than tiny-debounce)

2 lines (1 loc) 364 B
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.miniDebounce={})}(this,function(e){e.debounce=function(e,n){var t;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return clearTimeout(t),t=setTimeout(function(){return e.apply(void 0,o)},n)}}});