From 5e1eaef30c183c2b5ceb67da53bab4cca3f800b8 Mon Sep 17 00:00:00 2001 From: Ben Durrant Date: Tue, 9 Jul 2024 11:53:42 +0100 Subject: [PATCH] add NoInfer to Ext return --- src/createStore.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/createStore.ts b/src/createStore.ts index ac21df03c5..ee23a3c0cb 100644 --- a/src/createStore.ts +++ b/src/createStore.ts @@ -14,6 +14,8 @@ import ActionTypes from './utils/actionTypes' import isPlainObject from './utils/isPlainObject' import { kindOf } from './utils/kindOf' +type NoInfer = [T][T extends any ? 0 : never] + /** * @deprecated * @@ -47,7 +49,7 @@ export function createStore< >( reducer: Reducer, enhancer?: StoreEnhancer -): Store> & Ext +): Store> & NoInfer /** * @deprecated * @@ -83,7 +85,7 @@ export function createStore< reducer: Reducer, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer -): Store> & Ext +): Store> & NoInfer export function createStore< S, A extends Action, @@ -94,7 +96,7 @@ export function createStore< reducer: Reducer, preloadedState?: PreloadedState | StoreEnhancer | undefined, enhancer?: StoreEnhancer -): Store> & Ext { +): Store> & NoInfer { if (typeof reducer !== 'function') { throw new Error( `Expected the root reducer to be a function. Instead, received: '${kindOf(