Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

promise finally in js

let isLoading = true;

fetch(myRequest)
  .then(function(json) { /* process your JSON further */ })
  .catch(function(error) { console.error(error); /* this line can also throw, e.g. when console = {} */ })
  .finally(function() { isLoading = false; });
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #promise #finally #js
ADD COMMENT
Topic
Name
9+2 =