summaryrefslogtreecommitdiff
path: root/frontend/src/containers/UserRepo/reducer.js
blob: 82960a5895d570c55f10ab1cbd8cee5ec48de6cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { SET_USERNAME } from './actions'
import { fromJS } from 'immutable'
const initialState = fromJS({
  username: '',
  displayName: '',
  id: null
})

export default (state = initialState, action) => {
  switch (action.type) {
    case SET_USERNAME:
      return state.set('username', action.userName)
        .set('displayName', action.displayName)
        .set('id', action.index)
    default:
      return state
  }
}
bgstack15