Promise.any and Promise.allSettled

One benefit of Javascript proposal process is that there are always new things to learn and to make things more interesting. Promise.any and Promise.allSettled are not revolutionary but they will enable a new, more concise way to code. You can read more about them from here.

A caveat I found is that Promise.allSettled will never reject. It does make sense but at first I found myself thinking, “so when does it reject and what does it reject with?” I am interested to see how this behavior will be typed in Typescript.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s