A chainable function for delaying execution of a function or group of functions.
Parameters:
Name | Type | Description |
---|---|---|
fn | function | Function to execute. |
t | number | Delay time in milliseconds. |
- Since
- 1.0.0
- Source
Returns:
Returns the a function that can then be chained with another call.
- Type:
- function
Example
import { delay } from "@gravityforms/utils";
function Example() {
delay(fn1, 400).delay(fn2, 500);
}
function fn1() {
console.log( 'fn1: ' + Date.now() );
}
function fn2() {
console.log( 'fn2: ' + Date.now() );
}
Methods
(inner) schedule(fn, t)
Parameters:
Name | Type | Description |
---|---|---|
fn | ||
t |
- Source