Last active
May 18, 2022 03:15
-
-
Save SamiAlsubhi/96bb190b9d1a908b68593b88b3d45182 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
import axios from "axios"; | |
import axiosLock from "./axiosLock"; | |
const baseAxios = axios.create(); | |
//lock requests | |
baseAxios.interceptors.request.use(async (request) => { | |
if (axiosLock.isLocked) { | |
await axiosLock.waitForUnlock(); | |
} | |
return request | |
}) | |
export default baseAxios |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment