UNPKG

@aspectus/cancellable-promise-proxy

Version:

Simple Promise proxy to use `AbortController` to cancel underlying process.

23 lines (17 loc) 495 B
/*! * cancellable-promise-proxy v0.10.2 * (c) 2020 Alex Tkachenko * Released under the MIT License. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var promiseProxy = require('@aspectus/promise-proxy'); var main = promiseProxy.createProxy({ cancel: function cancel() { if (this.$data.cancelController && this.$data.cancelController.abort) { return this.$data.cancelController.abort(); } return false; } }); exports.default = main;