mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 11:03:57 +03:00
Remove deprecated updateStore method (#943)
This commit is contained in:
parent
5c375330b4
commit
16cad91ede
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user