cancelable-promise
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -42,3 +42,3 @@ const handleCallback = (resolve, reject, callback, r) => { | ||
this._promise.then( | ||
r => { | ||
(r) => { | ||
if (this._canceled) { | ||
@@ -53,3 +53,3 @@ p.cancel(); | ||
}, | ||
r => { | ||
(r) => { | ||
if (this._canceled) { | ||
@@ -56,0 +56,0 @@ p.cancel(); |
@@ -22,5 +22,3 @@ "use strict"; | ||
var CancelablePromise = | ||
/*#__PURE__*/ | ||
function () { | ||
var CancelablePromise = /*#__PURE__*/function () { | ||
_createClass(CancelablePromise, null, [{ | ||
@@ -27,0 +25,0 @@ key: "all", |
{ | ||
"name": "cancelable-promise", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "A simple cancelable promise", | ||
@@ -14,5 +14,6 @@ "main": "dist/CancelablePromise.js", | ||
"scripts": { | ||
"test": "mocha --opts mocha.opts", | ||
"test": "eslint . && mocha --opts mocha.opts", | ||
"build": "babel -d dist/ CancelablePromise.js", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"prettier": "prettier --write '*.{js,md}'" | ||
}, | ||
@@ -30,10 +31,11 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/cli": "~7.5.0", | ||
"@babel/core": "~7.5.4", | ||
"@babel/preset-env": "~7.5.4", | ||
"@babel/register": "~7.4.4", | ||
"@babel/cli": "~7.8.4", | ||
"@babel/core": "~7.9.0", | ||
"@babel/preset-env": "~7.9.0", | ||
"@babel/register": "~7.9.0", | ||
"chai": "~4.2.0", | ||
"mocha": "~6.1.4", | ||
"prettier": "~1.18.2" | ||
"eslint": "~6.8.0", | ||
"mocha": "~7.1.1", | ||
"prettier": "~2.0.4" | ||
} | ||
} |
# CancelablePromise | ||
A simple Cancelable Promise for browser | ||
@@ -13,3 +14,5 @@ | ||
## Usage | ||
CancelablePromise acts like a ES6 Promise: you can use `Promise.all`, `Promise.race` with your CancelablePromise for example. The only difference is you'll have a `cancel` method on your promise to cancel future execution of `then` or `catch` functions. CancelablePromise will also cancel all callbacks attached to new promises returned by `then`/`catch`. | ||
``` | ||
@@ -24,2 +27,3 @@ import CancelablePromise from 'cancelable-promise'; | ||
## Test | ||
You can run tests with `npm run test` |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
24703
28
0
8
165