Files
lume/src/utils/hooks/useActiveAccount.tsx
Ren Amamiya 5c7b18bf29 refactor
2023-05-26 09:28:49 +07:00

15 lines
292 B
TypeScript

import { getActiveAccount } from "@utils/storage";
import useSWR from "swr";
const fetcher = () => getActiveAccount();
export function useActiveAccount() {
const { data, error, isLoading } = useSWR("activeAcount", fetcher);
return {
account: data,
isLoading,
isError: error,
};
}