@stellar/stellar-sdk
Version:
A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.
23 lines (21 loc) • 421 B
JavaScript
class CancelToken {
promise;
reason;
throwIfRequested() {
if (this.reason) {
throw new Error(this.reason);
}
}
constructor(executor) {
let resolvePromise;
this.promise = new Promise((resolve) => {
resolvePromise = resolve;
});
executor((reason) => {
this.reason = reason;
resolvePromise();
});
}
}
export { CancelToken };
//# sourceMappingURL=types.js.map