fix(core): update
This commit is contained in:
parent
f3eac4a5f7
commit
b0772e2372
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartpromise',
|
name: '@pushrocks/smartpromise',
|
||||||
version: '4.0.1',
|
version: '4.0.2',
|
||||||
description: 'simple promises and Deferred constructs'
|
description: 'simple promises and Deferred constructs'
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,12 @@ export class Deferred<T> {
|
|||||||
public reject: IReject;
|
public reject: IReject;
|
||||||
public status: TDeferredStatus;
|
public status: TDeferredStatus;
|
||||||
public claimed = false;
|
public claimed = false;
|
||||||
|
public claim() {
|
||||||
|
if (this.claimed) {
|
||||||
|
throw new Error('Deferred already claimed');
|
||||||
|
}
|
||||||
|
this.claimed = true;
|
||||||
|
}
|
||||||
|
|
||||||
public startedAt: number;
|
public startedAt: number;
|
||||||
public stoppedAt: number;
|
public stoppedAt: number;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user