1 var baseDelay = require('./_baseDelay'),
2 rest = require('./rest');
5 * Defers invoking the `func` until the current call stack has cleared. Any
6 * additional arguments are provided to `func` when it's invoked.
11 * @param {Function} func The function to defer.
12 * @param {...*} [args] The arguments to invoke `func` with.
13 * @returns {number} Returns the timer id.
16 * _.defer(function(text) {
19 * // => logs 'deferred' after one or more milliseconds
21 var defer = rest(function(func, args) {
22 return baseDelay(func, 1, args);
25 module.exports = defer;