Refactor context reducer to TypeScript (#34506)

This commit is contained in:
Eugen Rochko 2025-04-28 15:38:40 +02:00 committed by GitHub
parent bd9223f0b9
commit 17d8e2b6e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 308 additions and 234 deletions

View file

@ -3,6 +3,7 @@ export type { GetState, AppDispatch, RootState } from './store';
export {
createAppAsyncThunk,
createAppSelector,
useAppDispatch,
useAppSelector,
} from './typed_functions';

View file

@ -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;