2 ms·
Considering how verbose the current UX of Redux is, this needs to be merged into mainline React. Are there any significant performance overhead? This is a reall
by sansnomme 6y ago
Considering how verbose the current UX of Redux is, this needs to be merged into mainline React. Are there any significant performance overhead? This is a really great library, the ergonomics look amazing and the documentation is just gorgeous.
- harrisonhope 6y agoThanks. It uses useDispatch behind the scenes which I believe has a bit more overhead compared to using connect. It should be comparable performance-wise to using the normal react-redux hooks.
- acemarke 6y agoUh... wait, _what_? `useDispatch` has absolutely no overhead whatsoever. It's literally just `return store.dispatch`. There's also less "overhead" in the sense that it's not pre-binding action creators. If you meant to say `useSelector` here, that also has less overhead than `connect` because it's having to select less state and do fewer comparisons.
- cercatrova 6y agoCheck out Redux Toolkit (https://redux-toolkit.js.org https://redux-toolkit.js.org), the `slices` feature changed my view on Redux entirely. Basically you can have a per-feature slice of functionality rather than having actions, reducers, and constants spread around your code. It's analogous to what hooks did, encapsulating similar functionality.