How to dynamically change/reset the polling interval? #5001
Unanswered
joaopbnogueira
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm writing an application where the polling interval may change depending on external data to be higher or lower than the initial value.
The query usage itself is quite simple:
What I am observing is the following:
configPollingInterval
variable is changed accordinglyWhat I would like to have is an immediate timer reset if the
configPollingInterval
changes, so in the timeline above, the request should fire at t101s approximately.How can this be achieved? I tried having a look at the source and docs but the best I could find was this middleware, that I was thinking I could use to use an example to manipulate the internal subscription state (https://github.com/reduxjs/redux-toolkit/blob/af3e75bb9e6a51e13603d2a5684ef3ba1da07e3b/packages/toolkit/src/query/core/buildMiddleware/polling.ts).
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions