How it works...
In step 4, we used the connect method provided by react-redux to empower the Album component with a connection to the Redux store we've been working on this entire chapter. The call to connect returns a function that is immediately executed via the second set of parentheses. By passing the Album component into this returning function, connect glues the component and the store together.
In step 5, we defined the mapStateToProps function. The first parameter in this function is state from the Redux store, which is injected into the function by connect. Whatever keys are defined in the object returned from mapStateToProps will be properties on the component's props. The value of these props will be subscribed to state in the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access