Trump stream
This commit is contained in:
parent
3235956181
commit
fb4fa3cecb
5 changed files with 96 additions and 23 deletions
|
@ -1,12 +1,14 @@
|
|||
import { ADD_ARTICLE } from '../constants/action-types'
|
||||
import { SET_CANDIDATE } from '../constants/action-types'
|
||||
import { DATA_LOADED } from '../constants/action-types'
|
||||
import { DATA_LOADED_TO_ADD } from '../constants/action-types'
|
||||
import { DATA_LOADED_TO_HILLARY } from '../constants/action-types'
|
||||
import { DATA_LOADED_TO_TRUMP } from '../constants/action-types'
|
||||
|
||||
const initialState = {
|
||||
articles: [],
|
||||
remoteArticles: [],
|
||||
remoteArticlesHillary: [],
|
||||
remoteArticlesTrump: [],
|
||||
candidate: ''
|
||||
}
|
||||
|
||||
|
@ -29,12 +31,18 @@ function rootReducer(state = initialState, action) {
|
|||
})
|
||||
}
|
||||
|
||||
else if (action.type === DATA_LOADED_TO_ADD) {
|
||||
else if (action.type === DATA_LOADED_TO_HILLARY) {
|
||||
return Object.assign({}, state, {
|
||||
remoteArticlesHillary: state.remoteArticlesHillary.concat(action.payload)
|
||||
})
|
||||
}
|
||||
|
||||
else if (action.type === DATA_LOADED_TO_TRUMP) {
|
||||
return Object.assign({}, state, {
|
||||
remoteArticlesTrump: state.remoteArticlesTrump.concat(action.payload)
|
||||
})
|
||||
}
|
||||
|
||||
return state
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue