Skip to content

Commit

Permalink
fix: legacy typescript fix for open-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
alisahinozcelik committed Nov 22, 2020
1 parent 1de38f4 commit 832b378
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/open-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,29 @@ export class OpenPromise<T = any> extends Promise<T> {
public get resolved(): boolean {
return this[RESOLVED];
}
public set resolved(value) {
throw new Error('Property `resolved` can not been set');
}

/**
* Returns whether is the promise rejected
*/
public get rejected(): boolean {
return this[REJECTED];
}
public set rejected(value) {
throw new Error('Property `rejected` can not been set');
}

/**
* Returns whether is the promise finished
*/
public get finished(): boolean {
return this[RESOLVED] || this[REJECTED];
}
public set finished(value) {
throw new Error('Property `finished` can not been set');
}

/**
* Binds a promise to the inner promise to resolve or reject with it
Expand Down

0 comments on commit 832b378

Please sign in to comment.