Infer redux types when possible

This commit is contained in:
Alejandro Celaya
2025-11-14 14:21:14 +01:00
parent 145765e3fa
commit ae7aea0e2c
11 changed files with 18 additions and 38 deletions

View File

@@ -1,12 +0,0 @@
import type { AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
import { createAsyncThunk as baseCreateAsyncThunk } from '@reduxjs/toolkit';
import type { ShlinkState } from '../../container/types';
export const createAsyncThunk = <Returned, ThunkArg>(
typePrefix: string,
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: ShlinkState, serializedErrorType: any }>,
) => baseCreateAsyncThunk(
typePrefix,
payloadCreator,
{ serializeError: (e) => e },
);