主题
defer
js
_.defer(func, [args])
推迟调用 func
,直到当前调用堆栈清除。在调用 func
时,将向其提供任何其他参数。
¥Defers invoking the func
until the current call stack has cleared. Any additional arguments are provided to func
when it's invoked.
新增于
¥Since
0.1.0
参数
¥Arguments
func
(函数):要延迟的函数。¥
func
(Function): The function to defer.[args]
(...*):用于调用func
的参数。¥
[args]
(...)*: The arguments to invokefunc
with.
返回
¥Returns
(数值):返回计时器 ID。
¥(number): Returns the timer id.
示例
¥Example
js
_.defer(function(text) {
console.log(text);
}, 'deferred');
// => Logs 'deferred' after one millisecond.