Replies: 1 comment 2 replies
-
Because it will trigger a refetch if the component is mounted and the cache entry is older than X or if the query argument changes (e.g. from Also see rtk-incubator/rtk-query#85 on naming. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In query options you can pass an option called
refetchOnMountOrArgChange
. It defaults to false, you can set it to either true or give it a number.There are several explanations in the docs. One is here:
Another part in the docs says this:
More often than not new team members are confused by this option and in particular why this option is called the way it's called. A more appropriate name would be something along the lines of
ignoreCachedValue
.To the actual question: what is the motivation between the OrArgChange portion of the name? Is this maybe related to old versions of rtk query in order to keep backwards compatibility? What does args refer to?
Beta Was this translation helpful? Give feedback.
All reactions