defer source npm
_.defer(func, [args])
Defers invoking the func
until the current call stack has cleared. Any
additional arguments are provided to func
when it's invoked.
Arguments
- func (Function)
The function to defer.
- [args] (...*)
The arguments to invoke the function with.
Returns (number)
Returns the timer id.
Example
_.defer(function(text) {
console.log(text);
}, 'deferred');
// logs 'deferred' after one or more milliseconds