Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Nov 15, 2022
1 parent 9ad8dbc commit 935eebd
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion source/utils/CancelablePromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,33 @@ export class CancelablePromise<T>
public onReject: (error: any)=> void;

public onCancel: ()=> void;


/**
* Flag to indicate if the promise has been fulfilled.
*
* Promise has ben fulfilled when value/error is set.
*/
public fulfilled: boolean = false;

/**
* Flag to indicate if the promise was rejected.
*
* Only set when the promise is fulfilled.
*/
public rejected: boolean = false;

/**
* Flag set true when the resolve of reject method are called.
*/
public called: boolean = false;

/**
* Output value of the promise.
*
* Set with the output value if promise was fulfilled and not rejected.
*
* Stores the error value if the promise was rejected.
*/
public value: T;

public constructor(executor: (resolve: (value: T | PromiseLike<T>)=> void, reject: (reason?: any)=> void)=> void)
Expand Down

0 comments on commit 935eebd

Please sign in to comment.