aboutsummaryrefslogtreecommitdiff
path: root/src/hooks/APIClient.ts
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-15 05:09:14 +0300
committerGitHub <noreply@github.com>2020-08-15 05:09:14 +0300
commit694918dcf0565e14dc4cba69e89907be9bed1544 (patch)
treeea5d41ef1878cef81d37125abe4a11d6018f130b /src/hooks/APIClient.ts
parent5ef1984e869529bdae38332c9ecf59661e08c364 (diff)
parentf2ad02d1f2aa5acaac430148dadfd2abc9e671e0 (diff)
downloadwhich-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.ts8
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);
};