Candidate swapping button
This commit is contained in:
parent
6759a05743
commit
a2b8e7480e
6 changed files with 77 additions and 34 deletions
|
@ -1,8 +1,10 @@
|
|||
import { ADD_ARTICLE } from '../constants/action-types'
|
||||
import { SET_CANDIDATE } from '../constants/action-types'
|
||||
|
||||
const initialState = {
|
||||
articles: [],
|
||||
remoteArticles: []
|
||||
remoteArticles: [],
|
||||
candidate: ''
|
||||
}
|
||||
|
||||
function rootReducer(state = initialState, action) {
|
||||
|
@ -12,6 +14,12 @@ function rootReducer(state = initialState, action) {
|
|||
})
|
||||
}
|
||||
|
||||
else if (action.type === SET_CANDIDATE) {
|
||||
return Object.assign({}, state, {
|
||||
candidate: action.payload
|
||||
})
|
||||
}
|
||||
|
||||
else if (action.type === "DATA_LOADED") {
|
||||
return Object.assign({}, state, {
|
||||
remoteArticles: state.remoteArticles.concat(action.payload.message.statuses)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue