Is it unreasonable to have data that only exist in your selectors and as props passed down from them? For example, I might have a short list of possible items. An action creator sends the new item. The reducer replaces the state with the new item. The component could have the list of items itself, but then it's not associated with state as much as the component. If the list comes from the selector, it's more associated with the state, and can be used in multiple components.
- Seems like it should be able to work.
- One concern could be that the selector might be doing a job it shouldn't be.
- The counter argument is that if you don't put it in the selector, it would need to go somewhere else, namely a component or in the state. If it's not stateful information, in the state doesn't make sense. If the component is supposed to be reusable with different list, then it doesn't make sense there either. The possible answer here is that it would go in a higher-order component or container.
samssh, yeah you make a specific component that wraps the reusable one
and the wrapper can be tied to the store
the wrapper can be as simple as a connect() call
- GreenJello, via IRC.