1 var baseDelay = require('../internal/baseDelay'),
2 restParam = require('./restParam');
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 the function with.
13 * @returns {number} Returns the timer id.
16 * _.defer(function(text) {
19 * // logs 'deferred' after one or more milliseconds
21 var defer = restParam(function(func, args) {
22 return baseDelay(func, 1, args);
25 module.exports = defer;