Hi Chibee,
Jon Lebensold

Thank you for your response.

I have two more questions…

  1. Why do you pass an empty object to createReducer? Shouldn’t this be the previous state?
  2. The name of the const (searchedRecipes) is the name of the key you are transforming in the state?

export const searchedRecipes = createReducer({}, { [types.SET_SEARCHED_RECIPES](state, action) { let newState = {} action.recipes.forEach( (recipe) => { let id = recipe.href newState[id] = Object.assign({}, recipe, { id }); }); return newState; }, });

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.