sashafirsov / css-chain

ApiChain and CssChain JS. Inherits collection API from element
Apache License 2.0
4 stars 0 forks source link

Promise methods #10

Open sashafirsov opened 1 year ago

sashafirsov commented 1 year ago

CssChain elements could have members/methods to return own status as a Promise object.

There is series of patterns of multiple promise use reflected in promise helper API:

Proposed .promiseAll(), .promiseAny(), .promiseAllSettled() to return the Promise object which would be resolved on each array element promise member or element as a Promise.

Signatures

If elements of $var CssChain have a promise API, following is identical:

await Promise.all( $var );
await $var.promiseAll();
await $var.promiseAll( el=>el.promise ); // when element has a promise property