JSPM

@jswork/next-make-cancelable

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q26603F
  • License MIT

Make promise cancelable for next.

Package Exports

  • @jswork/next-make-cancelable

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jswork/next-make-cancelable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

next-make-cancelable

Make promise cancelable for next.

version license size download

installation

npm install -S @jswork/next-make-cancelable

usage

import '@jswork/next-make-cancelable';

const somePromise = new Promise(r => setTimeout(r, 1000));
const cancelable = nx.makeCancelable(somePromise);

cancelable
  .promise
  .then(() => console.log('resolved'))
  .catch(({isCanceled, ...error}) => console.log('isCanceled', isCanceled));

// Cancel promise
cancelable.cancel();

license

Code released under the MIT license.