At this point, we have created a few actions for our app. As discussed earlier, actions define that something should happened, but we haven't created anything for putting the action into motion. That's where reducers come in. Reducers are functions that define how an action should affect the data in the Redux store. All accessing of data in the store happens in a reducer.
Reducers receive two parameters: state and action. The state parameter represents the global state of the app, and the action parameter is the action object being used by the reducer. Reducers return a new state parameter reflecting the changes that are associated with a given action parameter. In this recipe, we'll introduce a reducer for fetching the photos by using the actions we defined in the previous recipe.