Skip to content

Instantly share code, notes, and snippets.

@SamiAlsubhi
Last active May 18, 2022 03:15
Show Gist options
  • Save SamiAlsubhi/96bb190b9d1a908b68593b88b3d45182 to your computer and use it in GitHub Desktop.
Save SamiAlsubhi/96bb190b9d1a908b68593b88b3d45182 to your computer and use it in GitHub Desktop.
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