1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added useMemos to get data hooks

This commit is contained in:
Fedor Katurov 2022-01-09 19:28:23 +07:00
parent 1904153bba
commit d9feff085a
11 changed files with 49 additions and 19 deletions

View file

@ -1,4 +1,4 @@
import { useCallback } from 'react';
import { useCallback, useMemo } from 'react';
import { OAuthProvider } from '~/types/auth';
import { API } from '~/constants/api';
import { apiAttachSocial, apiDropSocial, apiGetSocials, apiLoginWithSocial } from '~/api/auth';
@ -89,13 +89,15 @@ export const useOAuth = () => {
[mutate]
);
const accounts = useMemo(() => data || [], [data]);
return {
openOauthWindow,
loginWithSocial,
createSocialAccount,
attachAccount,
dropAccount,
accounts: data || [],
accounts,
isLoading: !data && isLoading,
};
};