Skip to content

Instantly share code, notes, and snippets.

@sergiodxa
Last active August 29, 2015 14:21
Show Gist options
  • Save sergiodxa/d700f352ebbc6f399d16 to your computer and use it in GitHub Desktop.
Save sergiodxa/d700f352ebbc6f399d16 to your computer and use it in GitHub Desktop.
Callback hell
import xhr from 'xhr';
const config = { url: '/api/resource' }
xhr(config, response => {
xhr(config, response => {
xhr(config, response => {
xhr(config, response => {
xhr(config, response => {
xhr(config, response => {
xhr(config, response => {
console.log(response);
}, error => {
console.log(error);
});
}, error => {
console.log(error);
});
}, error => {
console.log(error);
});
}, error => {
console.log(error);
});
}, error => {
console.log(error)
});
}, error => {
console.log(error)
});
}, error => {
console.log(error)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment