traintrape-moi/client/hooks/useMoneyUpdates.ts

9 lines
449 B
TypeScript
Raw Normal View History

import { useAppDispatch, useAppSelector } from "./useStore"
import { downloadMoneyUpdates, MoneyUpdatesPayload } from "@/utils/features/moneyUpdates/moneyUpdatesSlice"
export const useMoneyUpdates = () => useAppSelector((state) => state.moneyUpdates.moneyUpdates)
export const useDownloadMoneyUpdates = () => {
const dispath = useAppDispatch()
return (moneyUpdatesData: MoneyUpdatesPayload) => dispath(downloadMoneyUpdates(moneyUpdatesData))
}