Skip to content

Commit 8a9ca01

Browse files
authored
Merge pull request #4717 from reduxjs/ts5.5
2 parents 42cc13b + 5e1eaef commit 8a9ca01

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
fail-fast: false
104104
matrix:
105105
node: ['20.x']
106-
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4']
106+
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5']
107107
steps:
108108
- name: Checkout repo
109109
uses: actions/checkout@v4

src/createStore.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import ActionTypes from './utils/actionTypes'
1414
import isPlainObject from './utils/isPlainObject'
1515
import { kindOf } from './utils/kindOf'
1616

17+
type NoInfer<T> = [T][T extends any ? 0 : never]
18+
1719
/**
1820
* @deprecated
1921
*
@@ -47,7 +49,7 @@ export function createStore<
4749
>(
4850
reducer: Reducer<S, A>,
4951
enhancer?: StoreEnhancer<Ext, StateExt>
50-
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
52+
): Store<S, A, UnknownIfNonSpecific<StateExt>> & NoInfer<Ext>
5153
/**
5254
* @deprecated
5355
*
@@ -83,7 +85,7 @@ export function createStore<
8385
reducer: Reducer<S, A, PreloadedState>,
8486
preloadedState?: PreloadedState | undefined,
8587
enhancer?: StoreEnhancer<Ext, StateExt>
86-
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
88+
): Store<S, A, UnknownIfNonSpecific<StateExt>> & NoInfer<Ext>
8789
export function createStore<
8890
S,
8991
A extends Action,
@@ -94,7 +96,7 @@ export function createStore<
9496
reducer: Reducer<S, A, PreloadedState>,
9597
preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined,
9698
enhancer?: StoreEnhancer<Ext, StateExt>
97-
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {
99+
): Store<S, A, UnknownIfNonSpecific<StateExt>> & NoInfer<Ext> {
98100
if (typeof reducer !== 'function') {
99101
throw new Error(
100102
`Expected the root reducer to be a function. Instead, received: '${kindOf(

0 commit comments

Comments
 (0)