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

do-when

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

do-when

Loop with setInterval until condition is true.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1.2K
-39.61%
Maintainers
2
Weekly downloads
 
Created
Source

when

Loop with setInterval until condition is truthy. We use it to test that third-party libraries have loaded the proper global variables onto window.

Not great, I know. Have a better idea? Let me know.

Installation

$ npm install do-when
$ component install segmentio/when

Example

when(function () {
  return requirement() === met;
}, function () {
  doStuff();
});

API

when(condition, callback, [interval=10])

When condition returns truthy, call the callback. Check every interval milliseconds, defaulting to 10.

License

MIT

Keywords

testing

FAQs

Package last updated on 15 May 2015

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