New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@react-corekit/sleep

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-corekit/sleep

Async/await timeout delay

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

@react-corekit/sleep

Non blocking asynchronous sleep. Due the nature of javascript an the event loop, it suspends the current function execution only. It does not pause the entire program execution.

NPM

Install

npm install --save @react-corekit/sleep
yarn add @react-corekit/sleep

Syntax

await sleep(n);
// Do something
sleep(n).then(() => {
  // Do something
});

Usage

import sleep from '@react-corekit/sleep';

async function run() {
  /* wait one second before 
      contitue this function execution */
  await sleep(1000);
}

run();

Additional documentation

The setTimeout() method

Async functions - making promises friendly

The basics of async/await

License

MIT © glongh

Keywords

timeout

FAQs

Package last updated on 29 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts