How to use the @esfx/cancelable.CancelError function in @esfx/cancelable

To help you get started, we’ve selected a few @esfx/cancelable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esfx / esfx / packages / async-delay / src / index.ts View on Github external
const subscription = Cancelable.subscribe(cancelable, () => {
            clearTimeout(handle);
            reject(new CancelError());
        });
    });
github esfx / esfx / packages / async-canceltoken / src / index.ts View on Github external
throwIfSignaled() {
        if (this.signaled) {
            const error = new CancelError();
            if (Error.captureStackTrace) {
                Error.captureStackTrace(error, throwIfSignaledMethod);
            }
            throw error;
        }
    }