buckyroberts / Vataxia-Frontend

Open source social network written in React and Redux
http://vataxia.io/
250 stars 77 forks source link

[Question] Usage of selectors #53

Open williamboman opened 7 years ago

williamboman commented 7 years ago

Thanks for open-sourcing this! We use almost the exact same stack as you (both front and back) and learned a lot from looking at your implementations.

What's your thoughts on using selectors everywhere, for everything, e.g.:

connect(state => ({
    activeUser: getActiveUser(state),
})(Login)

Or do you think selectors only should be used to slice parts of the state, preferably via memoized reselect selectors? Or not at all? Where would you define these selectors, I was thinking in the same file as its corresponding reducer?

I appreciate any response, thanks!