install gulp to process code
This commit is contained in:
parent
24f6606c2c
commit
b6a3900ee2
1651 changed files with 253427 additions and 39 deletions
26
node_modules/glob-watcher/lib/debounce.js
generated
vendored
Normal file
26
node_modules/glob-watcher/lib/debounce.js
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
function debounce(fn, delay) {
|
||||
var timeout;
|
||||
var args;
|
||||
var self;
|
||||
|
||||
return function () {
|
||||
self = this;
|
||||
args = arguments;
|
||||
clear();
|
||||
timeout = setTimeout(run, delay);
|
||||
};
|
||||
|
||||
function run() {
|
||||
clear();
|
||||
fn.apply(self, args);
|
||||
}
|
||||
|
||||
function clear() {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = debounce;
|
||||
Loading…
Add table
Add a link
Reference in a new issue