UNPKG

@aspectus/cancellable-promise-proxy

Version:

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

19 lines (15 loc) 400 B
/*! * cancellable-promise-proxy v0.10.2 * (c) 2020 Alex Tkachenko * Released under the MIT License. */ import { createProxy } from '@aspectus/promise-proxy'; var main = createProxy({ cancel: function cancel() { if (this.$data.cancelController && this.$data.cancelController.abort) { return this.$data.cancelController.abort(); } return false; } }); export default main;