A function to asynchronously execute when the promise becomes settled (fulfilled or rejected).
If the function returns a promise, the resulting promise will wait for that promise to settle
before continuing. If the returned promise is rejected, the resulting promise is rejected with
the same reason. Any other returned value, or the fulfilled value of the returned promise, is ignored.
A function to asynchronously execute when the promise becomes settled (fulfilled or rejected). If the function returns a promise, the resulting promise will wait for that promise to settle before continuing. If the returned promise is rejected, the resulting promise is rejected with the same reason. Any other returned value, or the fulfilled value of the returned promise, is ignored.