system-praktyk-front/src/state/actions/index.ts
2020-11-06 20:03:14 +01:00

45 lines
1.4 KiB
TypeScript

import { useDispatch as useReduxDispatch } from "react-redux";
import { EditionAction, EditionActions } from "@/state/actions/edition";
import { SettingActions, SettingsAction } from "@/state/actions/settings";
import { InternshipProposalAction, InternshipProposalActions } from "@/state/actions/proposal";
import { InternshipPlanAction, InternshipPlanActions } from "@/state/actions/plan";
import { InsuranceAction, InsuranceActions } from "@/state/actions/insurance";
import { UserAction, UserActions } from "@/state/actions/user";
import { ThunkDispatch } from "redux-thunk";
import { AppState } from "@/state/reducer";
import { StudentAction, StudentActions } from "@/state/actions/student";
export * from "./base"
export * from "./edition"
export * from "./settings"
export * from "./proposal"
export * from "./plan"
export * from "./user"
export * from "./student"
export type Action
= UserAction
| EditionAction
| SettingsAction
| InternshipProposalAction
| StudentAction
| InternshipPlanAction
| InsuranceAction;
export const Actions = {
...UserActions,
...EditionActions,
...SettingActions,
...InternshipProposalActions,
...InternshipPlanActions,
...InsuranceActions,
...StudentActions,
}
export type Actions = typeof Actions;
export type AppDispatch = ThunkDispatch<AppState, any, Action>;
export const useDispatch = () => useReduxDispatch<AppDispatch>()
export default Actions;