feat(cumulativedeferred): Added subDefer method to CumulativeDeferred

This commit is contained in:
2025-01-19 19:05:15 +01:00
parent a941ca69b3
commit d54b5790a3
5 changed files with 3835 additions and 350 deletions

View File

@ -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.'
}

View File

@ -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);
}