// Store Redux state = { cars: { carsById: { 1: { id: 1, name "Toyota" }, 2: { id: 2, name "Lexus" }, 3: { id: 3, name "Honda" } } } }; // selectors.js const carsSelector = state => state.cars.carsById; export const getCarsSelector = createSelector(carsSelector, carsById => Object.values(carsById)); // CarListPage.js class CarListPage extends PureComponent { ... render() { return (
{this.props.cars.map(car => )}
); }; ... } const mapStateToProps = state => { return { cars: getCarsSelector(state) }; };