Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try using ACR[T] over {} within ValidateSliceCaseReducers #3097

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/toolkit/src/createSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -253,7 +253,7 @@ export type ValidateSliceCaseReducers<
? {
prepare(...a: never[]): Omit<A, 'type'>
}
: {}
: ACR[T]
}

function getType(slice: string, actionKey: string): string {
Expand Down