Skip to content

Instantly share code, notes, and snippets.

@sergiodxa
Created May 29, 2015 20:09
Show Gist options
  • Save sergiodxa/d39cbf0a0d04ec7f25f7 to your computer and use it in GitHub Desktop.
Save sergiodxa/d39cbf0a0d04ec7f25f7 to your computer and use it in GitHub Desktop.
Promises heaven
import xhr from 'promised-xhr';
xhr.get('/api/resource')
.then(response => {
return xhr.get('/api/resource');
})
.then(response2 => {
console.log(response2);
})
.catch(error => {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment