I used in project react, redux and reselect. Is a preferred approach for apps, using reselect, to move all computable data from class methods to selectors and avoid mixing of use both, or this approaches has different concepts?
class DocsListView {
getOutdatedDocs() {
// computations from props
}
getPrimaryDocs() {
// computations from props
}
getDocs() {
if(this.props.showOutdated) {
return this.getOutdatedDocs();
}
return this.getPrimaryDocs();
}
render() {
return (
<DocsTable docs={this.getDocs()} />
)
}
}
export const DocsList = connect(createStructuredSelector({
allDocs: allDocsSelector,
showOutdated: outdatedFlagSelector,
getRecordsFromSomeDictForDocsComparsion: dictSelector(DICT),
// many Other Simple Selectors
}))(DocsListView)
What is the best place for class methods, described below in component chunk? Please note, question about conepts and misconepts not about optimisations