Skip to content

Instantly share code, notes, and snippets.

@sergiodxa
Created May 29, 2015 20:03
Show Gist options
  • Save sergiodxa/5d3ecc895c1961a8fd79 to your computer and use it in GitHub Desktop.
Save sergiodxa/5d3ecc895c1961a8fd79 to your computer and use it in GitHub Desktop.
El regreso de return
import xhr from 'promised-xhr';
xhr.get('/api/resource')
.then(response => {
let body = response.body;
// modificamos el body de alguna forma
return body;
})
.then(body => {
// volvemos a modificar el body
console.log(body);
})
.catch(error => {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment