fbjs
fbjs copied to clipboard
Does Promise.prototype.finally turn rejected promise to resolved in purpose?
I just using react-native which requires the project but got this issue.
Other promise implementations like well-known bluebird or the "promise" package itself have a ".finally" which won't change the promise state. I'm not sure why here it is different.
Can you post some code that shows this behavior?
var result = thingThatFails()
.finally((res) => { cleanUp(); return res; });
makes result a resolved promise, even if thingThatFails() returned a rejected one. It seems standard now for people to keep the resolution/rejection through a finally so we should probably switch; someone needs to look over our internal code to see if anything will break.