|
|
|
|
|
by kalkut
2902 days ago
|
|
Dispatch is another big culprit. I have exactly the same experience and implemented the same solution. An ex-colleague also did the same thing. We both worked on collaborative webapps but in different companies at the time so performance gain was very important. I still use Redux on some projects but I definitely start the new ones without thinking about it. |
|
Could you clarify what you mean by that?
Per both of your comments: generally speaking, your `mapState` functions _should_ run as quickly as possible. Ideally, a `mapState` function should just grab a couple values from the Redux state object and return those.
If a component needs the store data to be transformed in some way, we recommend using memoized selector functions [0] to cut down on unnecessary work.
So, in a well-written app, your `mapState` functions shouldn't be bottlenecks.
As I said, if you've got some examples of specific perf issues, I'd be happy to offer advice.
[0] https://blog.isquaredsoftware.com/2017/12/idiomatic-redux-us...