16 lines
368 B
TypeScript
16 lines
368 B
TypeScript
import {useState} from "react";
|
|
import axios from "axios";
|
|
|
|
const useAxiosTools = () => {
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
const [error, setError] = useState<string|null>(null)
|
|
|
|
const axiosGet = axios.get
|
|
const axiosPost = axios.post
|
|
|
|
return {loading, setLoading, error, setError, axiosGet, axiosPost}
|
|
}
|
|
|
|
export default useAxiosTools
|