Use 'as const' instead of readonly class object

This commit is contained in:
Matt Bierner
2019-11-07 20:31:32 -08:00
parent 08d9dd2c83
commit fdeb9aa9b8
6 changed files with 8 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ export namespace ServerResponse {
) { }
}
export const NoContent = new class { readonly type = 'noContent'; };
export const NoContent = { type: 'noContent' } as const;
export type Response<T extends Proto.Response> = T | Cancelled | typeof NoContent;
}

View File

@@ -47,7 +47,7 @@ namespace ServerState {
Errored
}
export const None = new class { readonly type = Type.None; };
export const None = { type: Type.None } as const;
export class Running {
readonly type = Type.Running;