Replies: 7 comments
data fetching라이브러리는 위와같은 리덕스의 단점을 해결
|
0 replies
SWR
import useSWR from "swr";
function Profile() {
const { data, error } = useSWR("/api/user", fetcher, options);
if (error) return <div>failed to load</div>;
if (!data) return <div>loading...</div>;
return <div>hello {data.name}!</div>;
}
|
0 replies
React Queryimport { useQuery } from "react-query";
const useUser = id => {
const result = useQuery(`/user/${id}`, fetcher, options);
return result;
};
function Example() {
const { isLoading, error, data } = useUser("123");
if (isLoading) return "Loading...";
if (error) return "An error has occurred: " + error.message;
return <div>hello {data.name}!</div>;
}
|
0 replies
RTK Query
|
0 replies
Redux Saga
|
0 replies
Redux Thunk
MiddleWare: dispatch 함수를 결합해서 새 dispatch 함수를 반환하는 고차함수
|
0 replies
결론
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
All reactions