Since there is a new Promise combinator called Promise.allSettled
I am interested in performing some code logic based on the status of the resolution of Promises.
eg:
Promise.allSettled([
callApi("http://example.com/wishlist"),
callApi("http://example.com/brands")
])
.then(([wishlist, brands]) => {
if(brands.status === "failed"){
notifyMe()
}
})
As you can see I am using a static value to compare the resolution status of promises brands.status === "failed"
You can call me paranoid, but how JavaScript is evolving this value might change in the future and I would prefer to have something less static.
My question is: Is there any Symbol.PromiseRejected|Symbol.PromiseResolved
or something relevant that encapsulates the promise resolution ?