diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-08-15 05:09:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 05:09:14 +0300 |
commit | 694918dcf0565e14dc4cba69e89907be9bed1544 (patch) | |
tree | ea5d41ef1878cef81d37125abe4a11d6018f130b /src/hooks/APIClient.ts | |
parent | 5ef1984e869529bdae38332c9ecf59661e08c364 (diff) | |
parent | f2ad02d1f2aa5acaac430148dadfd2abc9e671e0 (diff) | |
download | which-ui-694918dcf0565e14dc4cba69e89907be9bed1544.tar.gz |
Merge pull request #84 from which-ecosystem/dyno-wakeup
Wakeup dyno before showing layout
Diffstat (limited to 'src/hooks/APIClient.ts')
-rw-r--r-- | src/hooks/APIClient.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hooks/APIClient.ts b/src/hooks/APIClient.ts index f66ef2e..cf5d247 100644 --- a/src/hooks/APIClient.ts +++ b/src/hooks/APIClient.ts @@ -10,17 +10,17 @@ export const useUser = (username: string | null): Response<User> => { return useSWR( username && `/users?username=${username}`, (url: string) => get(url).then(response => response.data[0]) - ) as Response<User>; + ); }; export const useProfile = (id: string): Response<Poll[]> => { - return useSWR(id && `/profiles/${id}`, fetcher) as Response<Poll[]>; + return useSWR(id && `/profiles/${id}`, fetcher); }; export const useFeed = (): Response<Poll[]> => { - return useSWR('/feed', fetcher, { revalidateOnFocus: false }) as Response<Poll[]>; + return useSWR('/feed', fetcher, { revalidateOnFocus: false }); }; export const useFeedback = (): Response<Feedback[]> => { - return useSWR('/feedback', fetcher) as Response<Feedback[]>; + return useSWR('/feedback', fetcher); }; |