Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

p-wait-for

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-wait-for - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

9

index.d.ts

@@ -16,2 +16,11 @@ declare namespace pWaitFor {

readonly timeout?: number;
/**
Whether to run the check immediately rather than starting by waiting `interval` milliseconds.
Useful for when the check, if run immediately, would likely return `false`. In this scenario, set `leadingCheck` to `false`.
@default true
*/
readonly leadingCheck?: boolean;
}

@@ -18,0 +27,0 @@ }

7

index.js

@@ -8,2 +8,3 @@ 'use strict';

timeout: Infinity,
leadingCheck: true,
...options

@@ -33,3 +34,7 @@ };

check();
if (options.leadingCheck) {
check();
} else {
retryTimeout = setTimeout(check, options.interval);
}
});

@@ -36,0 +41,0 @@

5

package.json
{
"name": "p-wait-for",
"version": "3.1.0",
"version": "3.2.0",
"description": "Wait for a condition to be true",
"license": "MIT",
"repository": "sindresorhus/p-wait-for",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},

@@ -12,0 +13,0 @@ "engines": {

@@ -1,2 +0,2 @@

# p-wait-for [![Build Status](https://travis-ci.org/sindresorhus/p-wait-for.svg?branch=master)](https://travis-ci.org/sindresorhus/p-wait-for)
# p-wait-for

@@ -7,3 +7,2 @@ > Wait for a condition to be true

## Install

@@ -15,3 +14,2 @@

## Usage

@@ -29,6 +27,5 @@

## API
### pWaitFor(condition, [options])
### pWaitFor(condition, options?)

@@ -45,7 +42,7 @@ Returns a `Promise` that resolves when `condition` returns `true`. Rejects if `condition` throws or returns a `Promise` that rejects.

Type: `Object`
Type: `object`
##### interval
Type: `number`<br>
Type: `number`\
Default: `20`

@@ -57,3 +54,3 @@

Type: `number`<br>
Type: `number`\
Default: `Infinity`

@@ -63,3 +60,11 @@

##### leadingCheck
Type: `boolean`\
Default: `true`
Whether to run the check immediately rather than starting by waiting `interval` milliseconds.
Useful for when the check, if run immediately, would likely return `false`. In this scenario, set `leadingCheck` to `false`.
## Related

@@ -69,6 +74,1 @@

- [More…](https://github.com/sindresorhus/promise-fun)
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

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