-
Notifications
You must be signed in to change notification settings - Fork 77
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
Only re-render if action creator returns an object #99
Comments
@runemadsen Could you utilise the shouldComponentUpdate lifecycle method to solve your issue? |
Yes, we are currently using
I will happily send a PR if it's wanted. |
any interest on this? |
@runemadsen A PR will be great and will solve a real issue ;) |
@didierfranc @runemadsen @bravomartin ^ here is a PR |
Excellent! That's exactly what I need. Also very clean implementation 👍 @didierfranc please take a look and merge away 💯 |
First of all, thanks for the great library!
Here's a proposal for a feature: To allow an action creator to return
false
or{}
in order not to re-render the connected components.We're having an issue in our app where we need to have a timeout running every 100ms to fetch updates from a backend. Most of the time, this fetch returns an identical object to that in state and we don't want to re-render all our connected components. So our action creator looks like this (using immutable):
So we return an empty object if the data did not change. However, this still causes
react-waterfall
to re-render every connected component. It seems like it would be easy to implement something where we can returnfalse
or an empty object in order not to makereact-waterfall
re-render.Is this a PR that you would be interested in?
The text was updated successfully, but these errors were encountered: