traintrape-moi/client/hooks/useTrain.ts

9 lines
379 B
TypeScript
Raw Normal View History

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