debounce 防抖动函数

http://lodash.think2011.net/debounce

_.debounce(func, [wait=0], [options])

创建一个防抖动函数。 该函数会在 wait 毫秒后调用 func 方法。

返回具有防抖动功能的函数

// 避免窗口在变动时出现昂贵的计算开销。
jQuery(window).on('resize', _.debounce(calculateLayout, 150));
原文地址:https://www.cnblogs.com/mengfangui/p/9188073.html