import { A7ListType } from '@/pages/A7numData/data'

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

// 定义 action 类型
type Props = {
  type: 'A7/getList'
  payload: A7ListType[]
}

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

    default:
      return state
  }
}
