Created
November 1, 2020 01:29
-
-
Save neomatrixcode/f8c746a5f2f57981ecbb7f3bf95e9983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tareas = (state = [], action) => { | |
switch (action.type) { | |
case 'AGREGAR_TAREA': | |
return [ | |
...state, | |
{ | |
id: action.id, | |
text: action.text | |
} | |
] | |
default: | |
return state | |
} | |
} | |
function rootReducer(state = {}, action) { | |
return { | |
tareas: tareas(state.tareas, action) | |
}; | |
} | |
export default rootReducer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment