Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
795 bytes
|
Line | |
---|
1 | var baseDelay = require('./_baseDelay'),
|
---|
2 | baseRest = require('./_baseRest'),
|
---|
3 | toNumber = require('./toNumber');
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Invokes `func` after `wait` milliseconds. Any additional arguments are
|
---|
7 | * provided to `func` when it's invoked.
|
---|
8 | *
|
---|
9 | * @static
|
---|
10 | * @memberOf _
|
---|
11 | * @since 0.1.0
|
---|
12 | * @category Function
|
---|
13 | * @param {Function} func The function to delay.
|
---|
14 | * @param {number} wait The number of milliseconds to delay invocation.
|
---|
15 | * @param {...*} [args] The arguments to invoke `func` with.
|
---|
16 | * @returns {number} Returns the timer id.
|
---|
17 | * @example
|
---|
18 | *
|
---|
19 | * _.delay(function(text) {
|
---|
20 | * console.log(text);
|
---|
21 | * }, 1000, 'later');
|
---|
22 | * // => Logs 'later' after one second.
|
---|
23 | */
|
---|
24 | var delay = baseRest(function(func, wait, args) {
|
---|
25 | return baseDelay(func, toNumber(wait) || 0, args);
|
---|
26 | });
|
---|
27 |
|
---|
28 | module.exports = delay;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.