export const makeCancelablePromise = (promise) => {
    let cancel;
    const cancelPromise = new Promise((resolve, reject) => {
        cancel = reject.bind(null, { isCanceled: true });
    });
    const wrappedPromise = Promise.race([promise, cancelPromise]);
    // eslint-disable-next-line fp/no-mutating-assign
    return Object.assign(wrappedPromise, { cancel });
};
//# sourceMappingURL=makeCancelablePromise.js.map