This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useQuery } from 'react-query'; | |
| export const useFetchFirstTodo = () => { | |
| const { data, error, isLoading } = useQuery("fetchFirstTodo", fetchFirstTodo); | |
| // -> dispatch and action | |
| // -> manipulate the response before sending back to component | |
| // -> call another api | |
| // -> whatever makes sense for you to put here... | |
| return { data, error, isLoading } | |
| } |
OlderNewer