Skip to content
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

Multiple callbacks when using "then" #204

Open
luke-unifymonitor opened this issue May 9, 2018 · 4 comments
Open

Multiple callbacks when using "then" #204

luke-unifymonitor opened this issue May 9, 2018 · 4 comments
Labels

Comments

@luke-unifymonitor
Copy link

I'm using "then" to transform the response.

When combined with a refreshInterval it causes multiple requests if the props change.

Example in this code sandbox....

https://codesandbox.io/s/xrzrp27w4q

Click "Foo 1" and it calls api/1 every x seconds
Click "Foo 2" and it calls api/2 every x seconds with...but still calls api/1

@ryanbrainard
Copy link
Contributor

That code sandbox doesn't seem to be using then or refreshInterval. Your description also doesn't seem to be using then, two clicks. Can you please clarify?

@luke-unifymonitor
Copy link
Author

Hi Ryan,

Can you have another look? I've placed all the code in index.js now so should be able to see it all from the default view.

https://codesandbox.io/s/xrzrp27w4q

Thanks, Luke

@ryanbrainard
Copy link
Contributor

Thanks, definitely some kind of bug there. I haven't gotten a chance to dig into to see exactly what's wrong, but will mark this issue as a bug and will investigate more later (or if someone beats me to it, that's welcome :) )

@rjhilgefort
Copy link

I'm seeing this as well. My workaround was just to use another HOC that transformed the props after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants