React hooks

This commit is contained in:
Rodrigo Pedroso 2019-06-22 19:57:06 -04:00
commit abdda1e8d0
7 changed files with 169 additions and 168 deletions

View file

@ -23,12 +23,20 @@ function rootReducer(state = initialState, action) {
}
else if (action.type === DATA_LOADED) {
console.log('Payload: ' + action.payload)
return Object.assign({}, state, {
remoteArticles: action.payload.message.statuses
})
}
else if (action.type === DATA_LOADED_TO_ADD) {
console.log('Payload: ' + action.payload)
return Object.assign({}, state, {
remoteArticles: state.remoteArticles.concat(action.payload)
})
}
else if (action.type === "DATA_LOADED_TO_ADD_2") {
return Object.assign({}, state, {
remoteArticles: state.remoteArticles.concat(action.payload.message.statuses)
})