p-cancelable
Advanced tools
Comparing version 0.5.1 to 1.0.0
{ | ||
"name": "p-cancelable", | ||
"version": "0.5.1", | ||
"version": "1.0.0", | ||
"description": "Create a promise that can be canceled", | ||
@@ -42,4 +42,4 @@ "license": "MIT", | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^3.0.0", | ||
"ava": "^0.25.0", | ||
"delay": "^4.1.0", | ||
"promise.prototype.finally": "^3.1.0", | ||
@@ -46,0 +46,0 @@ "xo": "^0.23.0" |
@@ -60,3 +60,5 @@ # p-cancelable [![Build Status](https://travis-ci.org/sindresorhus/p-cancelable.svg?branch=master)](https://travis-ci.org/sindresorhus/p-cancelable) | ||
```js | ||
const cancelable = new PCancelable((resolve, reject, onCancel) => { | ||
const PCancelable = require('p-cancelable'); | ||
const cancelablePromise = new PCancelable((resolve, reject, onCancel) => { | ||
const job = new Job(); | ||
@@ -72,3 +74,3 @@ | ||
promise.cancel(); // Doesn't throw an error | ||
cancelablePromise.cancel(); // Doesn't throw an error | ||
``` | ||
@@ -115,2 +117,4 @@ | ||
```js | ||
const PCancelable = require('p-cancelable'); | ||
const fn = PCancelable.fn((input, onCancel) => { | ||
@@ -126,7 +130,7 @@ const job = new Job(); | ||
const promise = fn('input'); //=> PCancelable | ||
const cancelablePromise = fn('input'); //=> PCancelable | ||
// … | ||
promise.cancel(); | ||
cancelablePromise.cancel(); | ||
``` | ||
@@ -133,0 +137,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7859
0
156