Last active
          October 1, 2019 13:22 
        
      - 
      
 - 
        
Save dbayarchyk/d739fbd211347cd889badcd768105741 to your computer and use it in GitHub Desktop.  
    Async/await without try/catch in JavaScript
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function fetchAndUpdatePosts() { | |
| fetchPosts() | |
| .then((posts) => { | |
| updatePosts(posts) | |
| .catch((err) => { | |
| console.log('error in updating posts'); | |
| }); | |
| }) | |
| .catch(() => { | |
| console.log('error in fetching posts'); | |
| }); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment