When we perform an
promise
operation, often accompanied by various states to make changes (such as a request to display at the beginning loading
, at the end of the hidden loading
), this state changes, if there is no finally
function, we need to then
and catch
have written this code, but with finally
function, we just need to write the code to function, because the finally
function logic, after the completion of the request either success or failure will be executed
How to support
Installation package promise.prototype.finally
npm i promise.prototype.finally -S
References to the use of
require("promise.prototype.finally").shim();