React hooks
This commit is contained in:
parent
d545fbe636
commit
abdda1e8d0
7 changed files with 169 additions and 168 deletions
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue