2024-01-08 10:57:40 +00:00
|
|
|
import { createAsyncThunk } from '@reduxjs/toolkit';
|
2023-09-11 14:09:22 +00:00
|
|
|
import type { TypedUseSelectorHook } from 'react-redux';
|
2024-01-08 10:57:40 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
2023-09-11 14:09:22 +00:00
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
import type { AppDispatch, RootState } from './store';
|
|
|
|
|
|
|
|
export const useAppDispatch: () => AppDispatch = useDispatch;
|
|
|
|
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
|
|
|
|
|
|
|
export const createAppAsyncThunk = createAsyncThunk.withTypes<{
|
|
|
|
state: RootState;
|
|
|
|
dispatch: AppDispatch;
|
|
|
|
rejectValue: string;
|
|
|
|
}>();
|