import { A3ObjType } from '@/pages/A3dict/data'

// 初始化状态
const initState = {
  // 列表数据
  listObj: {} as A3ObjType
}

// 定义 action 类型
type Props = {
  type: 'A3/getList'
  payload: A3ObjType
}

// reducer
export default function userReducer(state = initState, action: Props) {
  switch (action.type) {
    // 获取列表数据
    case 'A3/getList':
      return { ...state, listObj: action.payload }

    default:
      return state
  }
}
