Skip to content

Instantly share code, notes, and snippets.

@mzabriskie
Created August 5, 2015 22:52
Show Gist options
  • Save mzabriskie/d894c08fbc324a2d6bec to your computer and use it in GitHub Desktop.
Save mzabriskie/d894c08fbc324a2d6bec to your computer and use it in GitHub Desktop.
// Abort a request using requestId
axios.get('/some/url', {
requestId: 'some-url'
})
.then((res) => {
console.log(res.data);
});
axios.abort('some-url');
// Abort a request using controller pattern
var req = axios
.get('/some/url')
.then((res) => {
console.log(res.data);
});
req.abort();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment