9 lines
379 B
TypeScript
9 lines
379 B
TypeScript
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))
|
|
}
|