1 | ;
|
2 | exports.__esModule = true;
|
3 | function debounce(func, wait, immediate) {
|
4 | var timeout;
|
5 | return function () {
|
6 | var context = this, args = arguments;
|
7 | var later = function () {
|
8 | timeout = null;
|
9 | if (!immediate) {
|
10 | func.apply(context, args);
|
11 | }
|
12 | };
|
13 | var callNow = immediate && !timeout;
|
14 | clearTimeout(timeout);
|
15 | timeout = setTimeout(later, wait);
|
16 | if (callNow) {
|
17 | func.apply(context, args);
|
18 | }
|
19 | };
|
20 | }
|
21 | exports["default"] = debounce;
|
22 | //# sourceMappingURL=debounce.js.map |
\ | No newline at end of file |