1 var baseDelay = require('./_baseDelay'),
2 baseRest = require('./_baseRest');
5 * Defers invoking the `func` until the current call stack has cleared. Any
6 * additional arguments are provided to `func` when it's invoked.
12 * @param {Function} func The function to defer.
13 * @param {...*} [args] The arguments to invoke `func` with.
14 * @returns {number} Returns the timer id.
17 * _.defer(function(text) {
20 * // => Logs 'deferred' after one millisecond.
22 var defer = baseRest(function(func, args) {
23 return baseDelay(func, 1, args);
26 module.exports = defer;