A CodeRoad tutorial for learning Redux.
CodeRoad is an open-sourced interactive tutorial platform for the Atom Editor. Learn more at CodeRoad.io.
-
install the tutorial package
npm install --save coderoad-redux-js
-
install and run the atom-coderoad plugin
Reducers must be pure functions
State is "read only".
Notes
const nextPokemon = state.pokemon.map(p => {
if (id === p.id) {
p.votes += 1;
}
return p;
});
return {
pokemon: nextPokemon
};