spee.ch/react/reducers/channel.js

25 lines
496 B
JavaScript
Raw Normal View History

import * as actions from 'constants/channel_action_types';
2018-01-18 18:33:26 +01:00
const initialState = {
loggedInChannel: {
name : null,
shortId: null,
longId : null,
},
};
/*
Reducers describe how the application's state changes in response to actions
*/
export default function (state = initialState, action) {
switch (action.type) {
case actions.CHANNEL_UPDATE:
return Object.assign({}, state, {
2018-02-06 21:11:44 +01:00
loggedInChannel: action.data,
2018-01-18 18:33:26 +01:00
});
default:
return state;
}
}