@tsed/platform-http
Version:
A TypeScript Framework on top of Express
21 lines (20 loc) • 479 B
JavaScript
import { AnyToPromise } from "@tsed/core";
export class AnyToPromiseWithCtx extends AnyToPromise {
constructor($ctx) {
super();
this.$ctx = $ctx;
}
isDone() {
const { $ctx } = this;
return $ctx?.isDone() || super.isDone();
}
call(cb) {
return super.call(() => cb(this));
}
destroy() {
this.$ctx = null;
}
isCanceledResponse(process) {
return process === this.$ctx.getResponse();
}
}