| 1 |
function reducer(state = { feeds: {}, profiles: {} }, action = {}) { |
| 2 |
switch (action.type) { |
| 3 |
case 'SET_TWITTER_FEED': |
| 4 |
if (!state.feeds[action.query] && action.feed) { |
| 5 |
state.feeds[action.query] = action.feed; |
| 6 |
} |
| 7 |
break; |
| 8 |
case 'SET_TWITTER_PROFILE': |
| 9 |
if (!state.profiles[action.query] && action.profile) { |
| 10 |
state.profiles[action.query] = action.profile; |
| 11 |
} |
| 12 |
break; |
| 13 |
// no default |
| 14 |
} |
| 15 |
|
| 16 |
return state; |
| 17 |
} |
| 18 |
|
| 19 |
export default reducer; |
| 20 |
|