is preferCacheValue the same as forceRefetch? #4621
Answered
by
EskiMojo14
davidjohnstoncoles
asked this question in
Q&A
-
The second argument of a lazyQueryTrigger is the boolean On the otherhand, if you were doing a endpoints.slice.initiate you could pass the property Are these functionally the same? |
Beta Was this translation helpful? Give feedback.
Answered by
EskiMojo14
Sep 13, 2024
Replies: 2 comments
-
it's exactly the opposite: preferCacheValue defaults to false, meaning it'll always force a refetch by default. Setting it true means that forceRefetch is false. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
davidjohnstoncoles
-
^ Cheers, thanks a lot. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's exactly the opposite:
redux-toolkit/packages/toolkit/src/query/react/buildHooks.ts
Line 961 in bc0bf0f
preferCacheValue defaults to false, meaning it'll always force a refetch by default. Setting it true means that forceRefetch is false.