I am using react-boilerplate
, and I am building a small kind of project so that I can understand the use of selectors.
I watched this video which I enjoyed a lot and I believe I have a clear understanding of where I should use selectors.
So what the video says is that we should use selectors when we want to combine 2 or more states of redux and as a result have a combined state (always correct me if I am wrong please).
So given that definition, I have the following questions,
- While using the boilerplate should I use selectors even if I don't have to combine 2 or more states?
For example, I have written the following selector
const selectCardRendererDomain = () => (state) => state.get('cardRenderer');
export {
selectCardRendererDomain,
};
Which doesn't make much sense if you ask me, but I like to keep things uniform in my projects so that I can easily follow the same flow every time I need to visit some old code.
- Are there any recipes that I can see how other, more experienced people are using selectors with the Boilerplate? I have already taken a look at the example of the boilerplate but I don't think that what I am looking for is there (again always correct me if I am wrong please).
Thanks in advance people