import { WallTableListType } from "@/types";

// 初始化状态
const initState = {
  // 列表数据
  list: [] as WallTableListType[],
};

// 定义 action 类型
type WallActionType = { type: "wall/getList"; payload: WallTableListType[] };

// 频道 reducer
export default function wallReducer(state = initState, action: WallActionType) {
  switch (action.type) {
    // 获取列表数据
    case "wall/getList":
      return { ...state, list: action.payload };
    default:
      return state;
  }
}
