9 lines
372 B
TypeScript
Raw Normal View History

import { downloadTrains, TrainsPayload } from "@/utils/features/train/trainSlice"
import { useAppDispatch, useAppSelector } from "./useStore"
2024-12-11 17:26:36 +01:00
export const useTrain = () => useAppSelector((state) => state.train)
export const useDownloadTrains = () => {
const dispath = useAppDispatch()
return (trainsData: TrainsPayload) => dispath(downloadTrains(trainsData))
}