I have a React application with a Redux store that connects to a websocket and displays the information to the user in a table. I have RxJs middleware that connects to the websocket and dispatches actions with the contents. Those then get picked up in a reducer and get saved to my state. I then mapStateToProps to display the data in my React components.
The issue is the updates come in faster than the renders can be. I could get 50 updates per second and if I render each time data comes in my app's performance would be terrible. I need a way to throttle the number of times mapStatetoProps gets called. I have a lot of components that map to this state and as of now I have 1 second throttles in shouldComponentUpdate for each one. It would be better if I could have the throttle of once per second at a lower level to avoid having duplicate logic across each one of my components. I also can't drop any of the 50 messages I get per second and just take the most recent because the data the user needs is spread across each message. Any ideas?