Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

delay

v4.17.11arrow_drop_down
v4.17.11
STATUS
Passing
DOWNLOADS
17
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 months ago
SIZE
2 KB
subject
Invokes `func` after `wait` milliseconds.
1 contributor
Use delay in your project ?
Copied
npm i @bit/lodash.lodash.delay
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
revert changes
reload
toggle layout
maximize
delay(
  function(text) {
    console.log(text);
  },
  1000,
  "later"
modifieddraft
chevron_left
chevron_right
delay (
func:Function,
wait:number,
args:...*?
) : number

Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked.

Example
_.delay(function(text) {
  console.log(text);
}, 1000, 'later');
// => Logs 'later' after one second.
Arguments
func: Function

The function to delay.

wait: number

The number of milliseconds to delay invocation.

args: ...*?

The arguments to invoke func with.

Returns
number

Returns the timer id.