Skip to content

Commit

Permalink
fix(95): remove storage of client
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Sep 15, 2023
1 parent 4ba6f84 commit 66af5ad
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState } from 'react'
import axios, { AxiosError } from 'axios'
import { useNavigate } from 'react-router-dom'

Expand All @@ -24,7 +23,7 @@ export class AxiosHttpRequestWithInterceptors extends BaseHttpRequest {
export const useHttpClient = () => {
const { credentials, logout } = useAuth()
const navigate = useNavigate()
const [client] = useState<HiveMqClient>(createInstance)
// const [client] = useState<HiveMqClient>(createInstance)

function createInstance() {
// Make sure to clear the interceptors, since axiosInstance is global
Expand Down Expand Up @@ -66,5 +65,5 @@ export const useHttpClient = () => {
)
}

return client
return createInstance()
}

0 comments on commit 66af5ad

Please sign in to comment.