feat(cumulativedeferred): Added subDefer method to CumulativeDeferred
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartpromise',
|
||||
version: '4.1.0',
|
||||
version: '4.2.0',
|
||||
description: 'A TypeScript library for managing promises and Deferred constructs, simplifying asynchronous programming.'
|
||||
}
|
||||
|
@ -15,6 +15,12 @@ export class CumulativeDeferred {
|
||||
}, 0);
|
||||
}
|
||||
|
||||
public subDefer() {
|
||||
const done = defer();
|
||||
this.addPromise(done.promise);
|
||||
return done;
|
||||
}
|
||||
|
||||
public addPromise(promiseArg: Promise<any>) {
|
||||
this.accumulatedPromises.push(promiseArg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user