From b10f3454a5fd872bc384f9cce18cf06c3b325c73 Mon Sep 17 00:00:00 2001 From: Ben Durrant Date: Sun, 1 Sep 2024 19:49:27 +0100 Subject: [PATCH] switch back to an interface --- packages/toolkit/src/asyncThunkCreator.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/toolkit/src/asyncThunkCreator.ts b/packages/toolkit/src/asyncThunkCreator.ts index d41019cc90..198fb3a1c9 100644 --- a/packages/toolkit/src/asyncThunkCreator.ts +++ b/packages/toolkit/src/asyncThunkCreator.ts @@ -83,15 +83,20 @@ export type AsyncThunkSliceReducerConfig< options?: AsyncThunkOptions } -export type AsyncThunkSliceReducerDefinition< +export interface AsyncThunkSliceReducerDefinition< State, ThunkArg extends any, Returned = unknown, ThunkApiConfig extends AsyncThunkConfig = {}, -> = AsyncThunkSliceReducerConfig & - ReducerDefinition & { - payloadCreator: AsyncThunkPayloadCreator - } +> extends AsyncThunkSliceReducerConfig< + State, + ThunkArg, + Returned, + ThunkApiConfig + >, + ReducerDefinition { + payloadCreator: AsyncThunkPayloadCreator +} /** * Providing these as part of the config would cause circular types, so we disallow passing them