1.0.7 • Published 5 years ago

@sharyn/util.wait v1.0.7

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

🌹 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
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago