- Refactored useSurvey hook to utilize useAxios for API calls. - Added spinner visibility management in EdgeProvider to improve loading feedback. - Cleaned up imports and organized code structure for better readability.
22 lines
418 B
TypeScript
22 lines
418 B
TypeScript
import { create } from 'zustand'
|
|
|
|
type SpinnerState = {
|
|
isShow: boolean
|
|
setIsShow: (isShow: boolean) => void
|
|
resetCount: () => void
|
|
}
|
|
|
|
type InitialState = {
|
|
isShow: boolean
|
|
}
|
|
|
|
const initialState: InitialState = {
|
|
isShow: false,
|
|
}
|
|
|
|
export const useSpinnerStore = create<SpinnerState>((set) => ({
|
|
...initialState,
|
|
setIsShow: (isShow: boolean) => set({ isShow }),
|
|
resetCount: () => set(initialState),
|
|
}))
|