Created
August 5, 2015 22:52
-
-
Save mzabriskie/d894c08fbc324a2d6bec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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