From 5c375330b497fef56fb381f5aa72ad6d4d58d26a Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Fri, 5 Nov 2021 16:22:04 -0400 Subject: [PATCH] Remove deprecated creation of store (#946) --- .../browser/extension/inject/pageScript.ts | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/extension/src/browser/extension/inject/pageScript.ts b/extension/src/browser/extension/inject/pageScript.ts index b7537388..287c5973 100644 --- a/extension/src/browser/extension/inject/pageScript.ts +++ b/extension/src/browser/extension/inject/pageScript.ts @@ -10,13 +10,11 @@ import { Dispatch, PreloadedState, Reducer, - Store, StoreEnhancer, StoreEnhancerStoreCreator, } from 'redux'; import Immutable from 'immutable'; import { EnhancedStore, PerformAction } from '@redux-devtools/instrument'; -import createStore from '../../../app/stores/createStore'; import configureStore, { getUrlParam } from '../../../app/stores/enhancerStore'; import { isAllowed, Options } from '../options/syncOptions'; import Monitor from '../../../app/service/Monitor'; @@ -133,11 +131,6 @@ export interface Config extends ConfigWithExpandedMaxAge { } interface ReduxDevtoolsExtension { - >( - reducer: Reducer, - preloadedState?: PreloadedState, - config?: Config - ): Store; (config?: Config): StoreEnhancer; open: (position?: Position) => void; updateStore: ( @@ -167,21 +160,10 @@ declare global { } function __REDUX_DEVTOOLS_EXTENSION__>( - reducer?: Reducer, - preloadedState?: PreloadedState, config?: Config -): Store; -function __REDUX_DEVTOOLS_EXTENSION__(config: Config): StoreEnhancer; -function __REDUX_DEVTOOLS_EXTENSION__>( - reducer?: Reducer | Config | undefined, - preloadedState?: PreloadedState, - config?: Config -): Store | StoreEnhancer { +): StoreEnhancer { /* eslint-disable no-param-reassign */ - if (typeof reducer === 'object') { - config = reducer; - reducer = undefined; - } else if (typeof config !== 'object') config = {}; + if (typeof config !== 'object') config = {}; /* eslint-enable no-param-reassign */ if (!window.devToolsOptions) window.devToolsOptions = {} as any; @@ -570,13 +552,7 @@ function __REDUX_DEVTOOLS_EXTENSION__>( }; }; - if (!reducer) return enhance(); - /* eslint-disable no-console */ - console.warn( - 'Creating a Redux store directly from DevTools extension is discouraged and will not be supported in future major version. For more details see: https://git.io/fphCe' - ); - /* eslint-enable no-console */ - return createStore(reducer, preloadedState, enhance); + return enhance(); } declare global {