-
Notifications
You must be signed in to change notification settings - Fork 8
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
How is startPolling and stopPolling supposed to work? #5
Comments
@K3CK Thank you for the kind words and sorry to see it not working as expected. Let me know if you still face any issues. |
Thanks for your fast response. But unfortunately it throws now a different error:
|
can you create a codesandbox link for me to check? |
I have a stupid question: I was wondering how do I get the body of the response in your example:
|
@fjacobs the response is always returned to the onSuccess handler so you can use that and then set your own local component state. For example in a twitter feed example you can have a local component with this.state = { feeds: [] } and on every polling success you might append the new tweets to this feed. I hope that answers your question. |
First of all: great work!
But I don't understand how those two functions are supposed to work. Calling them in the render property like so
render={({ startPolling, stopPolling, isPolling }) => { if (this.state.view === 'results') { stopPolling(); } }}
leads to an TypeError:
TypeError: Cannot read property '_ismounted' of undefined
What I'd like to to is to stop polling for a certain state in the application and re-start it after another event occurs.
The text was updated successfully, but these errors were encountered: