alkemics/CancelablePromise

Consider having a wrapper to make any Promise cancelable

Closed this issue · 2 comments

API suggestion

let promise = new Promise(...)
promise = CancelablePromise.from(promise);
promise.cancel();
let promise = new Promise(...)
promise = CancelablePromise.resolve(promise);
promise.cancel();

should do what you want. See https://codesandbox.io/s/ox1lw5908y

@mattberkowitz sounds good!