Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Redux with a UseState Hook. Parent comment
`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.
There are no comments on this comment yet.
`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.