Last updated 5 years ago
Was this helpful?
语法:
_.defer(func, [args])
源代码链接:
npm包链接:
描述:
推迟调用func,直到当前堆栈清理完毕。 调用时,任何附加的参数会传给func。
func
开始版本:0.1.0
参数:
func (Function): 要延迟的函数。
func (Function)
[args] (...*): 会在调用时传给 func 的参数。
[args] (...*)
返回值:
(number):返回计时器 id。
(number)
例子:
_.defer(function(text) { console.log(text); }, 'deferred'); // => 一毫秒或更久一些输出 'deferred'。