rudeshark.net/packages/megalodon/src/cancel.ts
ThatOneCalculator bdc35a343e
refactor: 🚨 linting fix
2023-07-16 15:32:32 -07:00

14 lines
290 B
TypeScript

export class RequestCanceledError extends Error {
public isCancel: boolean;
constructor(msg: string) {
super(msg);
this.isCancel = true;
Object.setPrototypeOf(this, RequestCanceledError);
}
}
export const isCancel = (value: any): boolean => {
return value && value.isCancel;
};