You could go either way, depending on your comfort with reducers.
I think the end result would impact my preference.
For example, I don't like having two pieces of state in a reducer that control the same outcome — index and pokemon.
I think it'd depend a lot of the final component whether I kept index or pokemon in the reducer.
I'll try to flesh that out a little more in the later lessons.
Thanks for asking!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How do you feel about putting
{index, pokemon}
into a reducer, so you only have one "state" object?Do you think it is too much here because they always update independently?
great question!
You could go either way, depending on your comfort with reducers.
I think the end result would impact my preference.
For example, I don't like having two pieces of state in a reducer that control the same outcome —
index
andpokemon
.I think it'd depend a lot of the final component whether I kept
index
orpokemon
in the reducer.I'll try to flesh that out a little more in the later lessons.
Thanks for asking!