17 lines
536 B
TypeScript
17 lines
536 B
TypeScript
import type { TypedUseSelectorHook } from 'react-redux';
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
|
|
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;
|
|
extra: { s: string; n: number };
|
|
}>();
|