Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
424
decreased by-16.54%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc