Comparing version 2.0.0 to 2.1.0
@@ -8,2 +8,32 @@ declare const pForever: { | ||
@returns Fulfills when `fn` returns `pForever.end`, or rejects if any of the promises returned from `fn` rejects. | ||
@example | ||
``` | ||
import pForever = require('p-forever'); | ||
pForever(async i => { | ||
i++; | ||
if (i > 100) { | ||
return pForever.end; | ||
} | ||
await createFixture(i); | ||
return i; | ||
}, 0); | ||
// or | ||
let i = 0; | ||
pForever(async () => { | ||
i++; | ||
if (i > 100) { | ||
return pForever.end; | ||
} | ||
await createFixture(i); | ||
}); | ||
``` | ||
*/ | ||
@@ -26,4 +56,7 @@ <ValueType>( | ||
readonly end: unique symbol; | ||
// TODO: Remove this for the next major release | ||
default: typeof pForever; | ||
}; | ||
export default pForever; | ||
export = pForever; |
@@ -15,4 +15,5 @@ 'use strict'; | ||
module.exports = pForever; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = pForever; | ||
module.exports.end = symbolEnd; |
{ | ||
"name": "p-forever", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Run promise-returning & async functions repeatedly until you end it", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -47,7 +47,7 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^1.3.1", | ||
"ava": "^1.4.1", | ||
"delay": "^4.1.0", | ||
"tsd-check": "^0.4.0", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -22,3 +22,3 @@ # p-forever [![Build Status](https://travis-ci.org/sindresorhus/p-forever.svg?branch=master)](https://travis-ci.org/sindresorhus/p-forever) | ||
pForever(i => { | ||
pForever(async i => { | ||
i++; | ||
@@ -43,3 +43,3 @@ | ||
pForever(() => { | ||
pForever(async () => { | ||
i++; | ||
@@ -46,0 +46,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5081
60