From 5868f773974b23dc1e447e872d02f7f643205d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 17 Jan 2023 19:25:39 +0100 Subject: [PATCH] Try using `ACR[T]` over `{}` within `ValidateSliceCaseReducers` --- packages/toolkit/src/createSlice.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/toolkit/src/createSlice.ts b/packages/toolkit/src/createSlice.ts index 8406a5b98e..5e4277bb4f 100644 --- a/packages/toolkit/src/createSlice.ts +++ b/packages/toolkit/src/createSlice.ts @@ -99,11 +99,11 @@ export interface CreateSliceOptions< /** * A callback that receives a *builder* object to define * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`. - * + * * Alternatively, a mapping from action types to action-type-specific *case reducer* * functions. These reducers should have existing action types used * as the keys, and action creators will _not_ be generated. - * + * * @example ```ts import { createAction, createSlice, Action, AnyAction } from '@reduxjs/toolkit' @@ -253,7 +253,7 @@ export type ValidateSliceCaseReducers< ? { prepare(...a: never[]): Omit } - : {} + : ACR[T] } function getType(slice: string, actionKey: string): string {