We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7be819 commit 5656af5Copy full SHA for 5656af5
src/api/fetchApi/index.ts
@@ -1,5 +1,6 @@
1
import axios from 'axios';
2
import { httpMethods } from '../constants';
3
+export const source = axios.CancelToken.source();
4
5
export const DEFAULT_HEADERS = {
6
Accept: 'application/json',
@@ -45,6 +46,7 @@ export const fetchApiWithAuthRequest = ({
45
46
method: method || httpMethods.get,
47
url,
48
data,
49
+ cancelToken: source.token,
50
headers: {
51
...DEFAULT_HEADERS,
52
...headers,
0 commit comments