Skip to content

Commit

Permalink
Merge pull request #17 from abraham/make-kind-readonly
Browse files Browse the repository at this point in the history
Make Class.kind be readonly
  • Loading branch information
abraham authored Jul 19, 2018
2 parents 51084b8 + ced05b6 commit e77cd0c
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 e77cd0c

Please sign in to comment.