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.
installation
npm install -S @jswork/next-make-cancelableusage
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.