import { useDispatch } from “react-redux”; import { getPosts } from “../store/posts/actions”; Now we can dispatch the action getPosts just after the component is mounted. let dispatch = useDispatch(); useEffect(() => { dispatch(getPosts()); }, []); The complete Home component will be the same as below.8 Eki 2021
Read moreHow does saga work?
Saga is an enchantment subtype. That means that every Saga is an enchantment. It will give you three effects, but not all of them at once. You’ll get some value immediately, and more during your following turns .
Read more