Loading mobile/src/hooks/useGet.ts +2 −0 Original line number Diff line number Diff line import { useEffect, useState } from "react"; import { ApiRequestStatus } from "../common/constants/api_request_states"; import { set } from "react-hook-form"; export const useGet = <T>(callback: () => Promise<T>) => { const [data, setData] = useState<T | null>(null); Loading @@ -9,6 +10,7 @@ export const useGet = <T>(callback: () => Promise<T>) => { const fetchData = async () => { try { await setLoading(); const response = await callback(); setData(response); setRequestStatus(ApiRequestStatus.SUCCESS); Loading Loading
mobile/src/hooks/useGet.ts +2 −0 Original line number Diff line number Diff line import { useEffect, useState } from "react"; import { ApiRequestStatus } from "../common/constants/api_request_states"; import { set } from "react-hook-form"; export const useGet = <T>(callback: () => Promise<T>) => { const [data, setData] = useState<T | null>(null); Loading @@ -9,6 +10,7 @@ export const useGet = <T>(callback: () => Promise<T>) => { const fetchData = async () => { try { await setLoading(); const response = await callback(); setData(response); setRequestStatus(ApiRequestStatus.SUCCESS); Loading