useWatch on async action not updating state #153
Unanswered
edwinwaite
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an async function that I am calling useWatch on like so:
const [started, finished, result, updating] = getJobsAsync.useWatch(jobsParams,
{
cacheBreakEnabled: true,
key: cacheKey.toString()
});
in a useEffect function I call getJobsAsync.run(...) based on some props. useWatch does not update any of the state (started, finished, updating) with the options defined:
{
cacheBreakEnabled: true,
key: cacheKey.toString()
}
If I remove the options, the state does get updated. I'm assuming it has something to do with cache break enabled. But I would think if cache is enabled then when the cache has timed out and the request to server is made the state would be upated. Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions