Refactor context reducer to TypeScript (#34506)
This commit is contained in:
parent
bd9223f0b9
commit
17d8e2b6e3
13 changed files with 308 additions and 234 deletions
|
@ -3,6 +3,7 @@ export type { GetState, AppDispatch, RootState } from './store';
|
|||
|
||||
export {
|
||||
createAppAsyncThunk,
|
||||
createAppSelector,
|
||||
useAppDispatch,
|
||||
useAppSelector,
|
||||
} from './typed_functions';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GetThunkAPI } from '@reduxjs/toolkit';
|
||||
import { createAsyncThunk } from '@reduxjs/toolkit';
|
||||
import { createAsyncThunk, createSelector } from '@reduxjs/toolkit';
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
|
@ -24,6 +24,8 @@ export const createAppAsyncThunk = createAsyncThunk.withTypes<{
|
|||
rejectValue: AsyncThunkRejectValue;
|
||||
}>();
|
||||
|
||||
export const createAppSelector = createSelector.withTypes<RootState>();
|
||||
|
||||
interface AppThunkConfig {
|
||||
state: RootState;
|
||||
dispatch: AppDispatch;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue