Remove deprecated updateStore method (#943)

This commit is contained in:
Nathan Bierema 2021-11-05 16:59:08 -04:00 committed by GitHub
parent 5c375330b4
commit 16cad91ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 25 deletions

View File

@ -695,25 +695,6 @@ export function connect(preConfig: Config): ConnectResponse {
};
}
export function updateStore<S, A extends Action<unknown>>(stores: {
[K in string | number]: EnhancedStore<S, A, unknown>;
}) {
return function (newStore: EnhancedStore<S, A, unknown>, instanceId: number) {
/* eslint-disable no-console */
console.warn(
'`__REDUX_DEVTOOLS_EXTENSION__.updateStore` is deprecated, remove it and just use ' +
"`__REDUX_DEVTOOLS_EXTENSION_COMPOSE__` instead of the extension's store enhancer: " +
'https://github.com/zalmoxisus/redux-devtools-extension#12-advanced-store-setup'
);
/* eslint-enable no-console */
const store = stores[instanceId || Object.keys(stores)[0]];
// Mutate the store in order to keep the reference
store.liftedStore = newStore.liftedStore;
store.getState = newStore.getState;
store.dispatch = newStore.dispatch;
};
}
export function isInIframe() {
try {
return window.self !== window.top;

View File

@ -29,7 +29,6 @@ import importState from '../../../app/api/importState';
import openWindow, { Position } from '../../../app/api/openWindow';
import generateId from '../../../app/api/generateInstanceId';
import {
updateStore,
toContentScript,
sendMessage,
setListener,
@ -133,10 +132,6 @@ export interface Config extends ConfigWithExpandedMaxAge {
interface ReduxDevtoolsExtension {
(config?: Config): StoreEnhancer;
open: (position?: Position) => void;
updateStore: (
newStore: EnhancedStore<unknown, Action<unknown>, unknown>,
instanceId: number
) => void;
notifyErrors: (onError?: () => boolean) => void;
send: <S, A extends Action<unknown>>(
action: StructuralPerformAction<A> | StructuralPerformAction<A>[],
@ -564,7 +559,6 @@ declare global {
// noinspection JSAnnotator
window.__REDUX_DEVTOOLS_EXTENSION__ = __REDUX_DEVTOOLS_EXTENSION__ as any;
window.__REDUX_DEVTOOLS_EXTENSION__.open = openWindow;
window.__REDUX_DEVTOOLS_EXTENSION__.updateStore = updateStore(stores);
window.__REDUX_DEVTOOLS_EXTENSION__.notifyErrors = notifyErrors;
window.__REDUX_DEVTOOLS_EXTENSION__.send = sendMessage;
window.__REDUX_DEVTOOLS_EXTENSION__.listen = setListener;