import {CHANNEL_GETCHANNEL,SET_ACTIVE} from '../action/acttionTypes'
// 定义频道的state
const inintChannels={
channel:[],
activeId:0
}
// 定义action
export const channel=(state = inintChannels, action)=> {
// console.log('reducer:', state, action)
switch (action.type) {
case SET_ACTIVE:
return {...state,activeId:action.payload}
// 处理频道列表
case CHANNEL_GETCHANNEL:
return {...state,channel:action.payload}
default:
return state
}
}