I have an app, where we poll the backend every 5 seconds, which returns all the app data. The return can be quite large, and many components are using the data.
Unfortunately, polling is the only method right now. I’m currently trying to use React-redux.
Every 5 seconds, I dispatch an action to fetch the latest data. The data might be exactly the same. However, since this is a new reference, the data is treated as new, and everything that uses useAppSelector gets re-rendered.
What’s the best practice here when it comes to polling data and react-redux? Do we pass in a custom deep equal function ?