Simple example

Open Chrome Dev Tools Network Tab and enable network throttling to achieve sending parallel requests. Hit Send a request button a few times and you will see that once another request is sent while previous is still in progress the previous is canceled so just one request at the time is active

Note: if you testing it locally within the cloned repo - make sure you are opening this file via web server. file:/// doesn't work with CORS so you won't be able to send request with axios, so it has to be something like http://localhost:3000/index.html

Custom axios instance example

In order to use custom axios instance you have to pass CancelToken and isCancel as additional arguments.
That's because custom instances don't have all of the base axios properties. Read more the author response in this issue https://github.com/axios/axios/issues/1330