What is the difference between useGetQuery() and useLazyGetQuery() in redux toolkit and when to use them?
What is the difference between useGetQuery() and useLazyGetQuery() in redux toolkit and when to use them?
A React hook similar to
useQuery, but with manual control over when the data fetching occurs.
const [trigger, result, lastPromiseInfo] =
api.endpoints.getPosts.useLazyQuery(options)
// or
const [trigger, result, lastPromiseInfo] = api.useLazyGetPostsQuery(options)