var gulp = require('gulp'); var cleancss = require('gulp-clean-css'); var uglify = require('gulp-uglify'); var htmlmin = require('gulp-htmlmin'); var htmlclean = require('gulp-htmlclean');
functiondebounce(func, wait, immediate) { var timeout returnfunction () { var context = this var args = arguments var later = function () { timeout = null if (!immediate) func.apply(context, args) } var callNow = immediate && !timeout clearTimeout(timeout) timeout = setTimeout(later, wait) if (callNow) func.apply(context, args) } };
functionthrottle(func, wait, mustRun) { var timeout var startTime = newDate()
returnfunction () { var context = this var args = arguments var curTime = newDate()