I would rather use a polyfill than use axios, but that is again a personal preference. If there are other features that axios provides (specific to the use case), I might go for it. You could just use the first approach of a boolean flag as well.
But if it is just cancellation support for IE, you could take a look at the example repo
An experienced software developer with a strong background in developing award-winning web and mobile applications for diverse clients with 6+ years of industry experience.
I would rather use a polyfill than use axios, but that is again a personal preference. If there are other features that axios provides (specific to the use case), I might go for it. You could just use the first approach of a boolean flag as well.
But if it is just cancellation support for IE, you could take a look at the example repo
Install:
Add the following:
There are other features like request and response interceptors that axios provides by the way.
As I mentioned, if there are other features that you are using, go for it. But most people are not using those features, thus the recommendation.