Skip to content

Commit 51aecbc

Browse files
committed
simplify selectSlice types
1 parent bfc9bae commit 51aecbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/toolkit/src/createSlice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export interface ReducerHandlingContext<State> {
287287
*
288288
* *Note that only the original `reducerPath` option is used - if a different `reducerPath` is used when injecting, this will not be reflected.*
289289
*/
290-
selectSlice(state: Record<string, State>): State
290+
selectSlice(state: Record<string, unknown>): State
291291
}
292292

293293
export interface ReducerDetails {
@@ -1004,7 +1004,7 @@ export function buildCreateSlice<
10041004
`Could not find "${name}" slice in state. In order for slice creators to use \`context.selectSlice\`, the slice must be nested in the state under its reducerPath: "${reducerPath}"`,
10051005
)
10061006
}
1007-
return sliceState
1007+
return sliceState as State
10081008
},
10091009
}
10101010
return context

0 commit comments

Comments
 (0)