Skip to content

Commit

Permalink
Make Class.kind be readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham committed Jul 19, 2018
1 parent 51084b8 commit ced05b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export enum Kinds {
}

export class Initialized {
public kind: typeof Kinds.Initialized = Kinds.Initialized;
readonly kind = Kinds.Initialized;
}

export class Pending {
public kind: typeof Kinds.Pending = Kinds.Pending;
readonly kind = Kinds.Pending;
}

export class Failure<E> {
public kind: typeof Kinds.Failure = Kinds.Failure;
readonly kind = Kinds.Failure;

constructor(public error: E) {
if (error === null || error === undefined) {
Expand All @@ -26,7 +26,7 @@ export class Failure<E> {
}

export class Success<D> {
public kind: typeof Kinds.Success = Kinds.Success;
readonly kind = Kinds.Success;

constructor(public data: D) {
if (data === null || data === undefined) {
Expand Down

0 comments on commit ced05b6

Please sign in to comment.