Advertisement
edwinjackson

Untitled

Jun 26th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const promise = fetch('http://example.com')
  2.  
  3. promise.then((result) => {
  4.     // use result...
  5. })
  6.  
  7. promise.catch((error) => {
  8.     // do something with the error
  9. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement