Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

1234567891011121314151617181920212223242526
  1. var baseDelay = require('./_baseDelay'),
  2. baseRest = require('./_baseRest');
  3. /**
  4. * Defers invoking the `func` until the current call stack has cleared. Any
  5. * additional arguments are provided to `func` when it's invoked.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @since 0.1.0
  10. * @category Function
  11. * @param {Function} func The function to defer.
  12. * @param {...*} [args] The arguments to invoke `func` with.
  13. * @returns {number} Returns the timer id.
  14. * @example
  15. *
  16. * _.defer(function(text) {
  17. * console.log(text);
  18. * }, 'deferred');
  19. * // => Logs 'deferred' after one millisecond.
  20. */
  21. var defer = baseRest(function(func, args) {
  22. return baseDelay(func, 1, args);
  23. });
  24. module.exports = defer;