import { downloadTrains, TrainsPayload } from "@/utils/features/train/trainSlice" import { useAppDispatch, useAppSelector } from "./useStore" export const useTrain = () => useAppSelector((state) => state.train.trains) export const useDownloadTrains = () => { const dispath = useAppDispatch() return (trainsData: TrainsPayload) => dispath(downloadTrains(trainsData)) }