async/standby

Resolves a promise after a delay.

Source:

Methods

(static) standby(timeoutopt) → {Promise.<void>}

Source:
Example
import { standby } from '@untemps/utils/async/standby'

const fn = async () => {
  console.log("Start delay")
  await standby(3000)
  console.log("End delay")
}
fn()
Parameters:
Name Type Attributes Default Description
timeout number <optional>
128

The delay before resolving the promise (in milliseconds).

Returns:

The promise to be resolved.

Type
Promise.<void>