@sharyn/util.wait
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

🌹 wait

wait: A Promise-based delay.

Installation

npm i @sharyn/util.wait
# or
yarn add @sharyn/util.wait

You can alternatively install the @sharyn/util package, or the entire sharyn library.

Arguments

[milliseconds=1000] (number): The duration of the wait.

Returns

Promise

Example

const main = async () => {
  console.log('Legen - wait for it...')
  await wait(3000)
  console.log('...dary!')
}

main()

Imports

Depending on the package you are using, you can import or require wait in the following ways:

// If you installed @sharyn/util.wait
import wait from '@sharyn/util.wait' // smaller size, better for client bundles

// If you installed @sharyn/util
import wait from '@sharyn/util/wait' // smaller size, better for client bundles
import { wait } from '@sharyn/util' // more convenient in Node environments

// If you installed sharyn
import wait from 'sharyn/util/wait' // smaller size, better for client bundles
import { wait } from 'sharyn/util' // more convenient in Node environments

This package is part of Sharyn, a collection of utilities and helpers.

Readme

Keywords

none

Package Sidebar

Install

npm i @sharyn/util.wait

Weekly Downloads

3

Version

1.0.7

License

MIT

Unpacked Size

3.28 kB

Total Files

5

Last publish

Collaborators

  • sharyn