diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-30 15:06:43 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-30 15:06:43 +0100 |
commit | e8ff4c8e56650bf061c63a7da3d84b742e618b6a (patch) | |
tree | cb9aa48393bc6108655db7490434ae29d3145ee5 /app/assets/javascripts/components/reducers/user_lists.jsx | |
parent | 7060bdf04bde59aab9addce95f00d6e1075a62ba (diff) |
Refactoring redux state into different reducers
Diffstat (limited to 'app/assets/javascripts/components/reducers/user_lists.jsx')
-rw-r--r-- | app/assets/javascripts/components/reducers/user_lists.jsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/reducers/user_lists.jsx b/app/assets/javascripts/components/reducers/user_lists.jsx index ee4b84296..d3b073e95 100644 --- a/app/assets/javascripts/components/reducers/user_lists.jsx +++ b/app/assets/javascripts/components/reducers/user_lists.jsx @@ -1,12 +1,14 @@ import { FOLLOWERS_FETCH_SUCCESS, FOLLOWING_FETCH_SUCCESS -} from '../actions/accounts'; -import Immutable from 'immutable'; +} from '../actions/accounts'; +import { SUGGESTIONS_FETCH_SUCCESS } from '../actions/suggestions'; +import Immutable from 'immutable'; const initialState = Immutable.Map({ followers: Immutable.Map(), - following: Immutable.Map() + following: Immutable.Map(), + suggestions: Immutable.List() }); export default function userLists(state = initialState, action) { @@ -15,6 +17,8 @@ export default function userLists(state = initialState, action) { return state.setIn(['followers', action.id], Immutable.List(action.accounts.map(item => item.id))); case FOLLOWING_FETCH_SUCCESS: return state.setIn(['following', action.id], Immutable.List(action.accounts.map(item => item.id))); + case SUGGESTIONS_FETCH_SUCCESS: + return state.set('suggestions', Immutable.List(action.accounts.map(item => item.id))); default: return state; } |