// redux/reducers/moveReducer.ts import { FETCH_MOVES } from '../constants'; import { Move } from "../../entities/Move"; import { AnyAction } from "redux"; export type MoveState = { moves: Move[]; }; type MoveAction = AnyAction & { type: typeof FETCH_MOVES; payload?: Move[]; }; const initialState: MoveState = { moves: [], } export default function moveReducer(state = initialState, action: MoveAction): MoveState { switch (action.type) { case FETCH_MOVES: return { ...state, moves: action.payload || [] }; default: return state; } }