Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript promises

let dataIsLoading = true;

promise
  .then(data => {
    // do something with data
  })
  .catch(error => {
   // do something with error
  })
  .finally(() => {
    dataIsLoading = false;
  })
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #javascript #promises
ADD COMMENT
Topic
Name
9+9 =