-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Few parameters needed to be added for polling (if window active & if window focus) #446
Comments
@favger I don't think I would add window listeners into the core, this is too opinionated and DOM dependent. What we could probably do is a way to pause/resume pollings. Interestingly, I don't think we need to add anything to core, as instead of pause/resume polling, you can just
We could also add Then, you would use whatever logic you want, like yours, to set this Btw, if you use polling, you might be also interested in recently added websocket and subscriptions! |
@klis87 I was just trying to explain the situation. I have no idea how to integrate the features into the library. "Then, you would use whatever logic you want, like yours, to set this pausePolling flag, and pause/resume logic will be done for you. Is that solution suitable for you?"
I hope I could explain the situation... 😃 |
I understand, but we cannot add opinionated things to the core, as API will grow too much, I want to keep things as flexible and minimalistic as possible
If I understand correctly yes, you would put whatever logic you need like
My version I guess not, probably several hours, but I am very busy recently, and also have other tasks on TODO list, so I don't know when this could be added. But I would always accept a PR! If not, it is possible to wrap |
Got it, thank you very much for your interest. I'll work with a private wrapper as you said and share the solution here. |
meta: {
pollWhenHidden: false,
revalidateOnFocus: false
}
redux-requests/packages/redux-requests/src/middleware/create-polling-middleware.js
Lines 44 to 53 in 0176826
Something like this (pollWhenHidden):
Something like this (revalidateOnFocus):
@klis87 We need your help in this matter.
It's going to be a super but super thing if we integrate it into the library.
The text was updated successfully, but these errors were encountered: