-
Notifications
You must be signed in to change notification settings - Fork 75
Description
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):
{
actionsCreators: {
syncData: async ({ data }) => {
const newData = await api.get('/data');
return data.equals(newData) ? {} : { data: newData };
}
}
}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 return false or an empty object in order not to make react-waterfall re-render.
Is this a PR that you would be interested in?