It misses the use case for finally. In all instances where you used finally, then could have been used also. The point of finally is that you don’t have to catch the error first, and it does not change the resolved value if the chain was successful.
The action should do all the error handling, but you can’t trust it. You don’t have to. You just know that whatever happens, when it’s over you need to stop the loading animation.
It misses the use case for finally. In all instances where you used
finally
,then
could have been used also. The point offinally
is that you don’t have to catch the error first, and it does not change the resolved value if the chain was successful.Thanks for the feedback @theblacklounge. About this:
Could you please expand on your answer (or provide example)?
For example a generic button with a loading animation which takes an
action
Promise.The action should do all the error handling, but you can’t trust it. You don’t have to. You just know that whatever happens, when it’s over you need to stop the loading animation.