Skip to content

Releases: alkemics/CancelablePromise

3.1.0

28 Apr 12:54
c592c48
Compare
Choose a tag to compare
  • upgrade dev dependencies
  • add isCanceled method to cancelable promises

3.0.0

19 Apr 13:43
1987549
Compare
Choose a tag to compare
  • Complete rewrite of CancelablePromise.
    Now promises returned from Promise API such as then or catch can cancel the root promise and all promises created from this root promise:
// CancelablePromise v2
import CancelablePromise from 'cancelable-promise';

const promise = new CancelablePromise((resolve) => setTimeout(resolve, 1))
  .then(() => console.log('callback2 executed'))
  .then(() => console.log('callback3 executed'));
promise.cancel();
// logs:
// callback2 executed
// callback3 executed
// CancelablePromise v3
import CancelablePromise from 'cancelable-promise';

const promise = new CancelablePromise((resolve) => setTimeout(resolve, 1))
  .then(() => console.log('callback2 executed'))
  .then(() => console.log('callback3 executed'));
promise.cancel();
// no logs
  • a functionnal util has been added:
import { cancelable } from 'cancelable-promise';

cancelable(new Promise((resolve) => setTimeout(resolve, 1)));
  • UMD module, CancelablePromise can be loaded in browser

2.6.0

08 Apr 21:39
a710ea8
Compare
Choose a tag to compare
v2.6.0

Create nodejs.yml