Threads for admerox

    1. 2

      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.

      1. 1

        Thanks for the feedback @theblacklounge. About this:

        The point of finally is that you don’t have to catch the error first,

        Could you please expand on your answer (or provide example)?

        1. 1

          For example a generic button with a loading animation which takes an action Promise.

          button.onclick = () => {
            setLoading(true);
            action.finally(setLoading(false));
          

          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.