mirror of
				https://github.com/reduxjs/redux-devtools.git
				synced 2025-11-04 09:57:26 +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() {
 | 
					export function isInIframe() {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    return window.self !== window.top;
 | 
					    return window.self !== window.top;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,6 @@ import importState from '../../../app/api/importState';
 | 
				
			||||||
import openWindow, { Position } from '../../../app/api/openWindow';
 | 
					import openWindow, { Position } from '../../../app/api/openWindow';
 | 
				
			||||||
import generateId from '../../../app/api/generateInstanceId';
 | 
					import generateId from '../../../app/api/generateInstanceId';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  updateStore,
 | 
					 | 
				
			||||||
  toContentScript,
 | 
					  toContentScript,
 | 
				
			||||||
  sendMessage,
 | 
					  sendMessage,
 | 
				
			||||||
  setListener,
 | 
					  setListener,
 | 
				
			||||||
| 
						 | 
					@ -133,10 +132,6 @@ export interface Config extends ConfigWithExpandedMaxAge {
 | 
				
			||||||
interface ReduxDevtoolsExtension {
 | 
					interface ReduxDevtoolsExtension {
 | 
				
			||||||
  (config?: Config): StoreEnhancer;
 | 
					  (config?: Config): StoreEnhancer;
 | 
				
			||||||
  open: (position?: Position) => void;
 | 
					  open: (position?: Position) => void;
 | 
				
			||||||
  updateStore: (
 | 
					 | 
				
			||||||
    newStore: EnhancedStore<unknown, Action<unknown>, unknown>,
 | 
					 | 
				
			||||||
    instanceId: number
 | 
					 | 
				
			||||||
  ) => void;
 | 
					 | 
				
			||||||
  notifyErrors: (onError?: () => boolean) => void;
 | 
					  notifyErrors: (onError?: () => boolean) => void;
 | 
				
			||||||
  send: <S, A extends Action<unknown>>(
 | 
					  send: <S, A extends Action<unknown>>(
 | 
				
			||||||
    action: StructuralPerformAction<A> | StructuralPerformAction<A>[],
 | 
					    action: StructuralPerformAction<A> | StructuralPerformAction<A>[],
 | 
				
			||||||
| 
						 | 
					@ -564,7 +559,6 @@ declare global {
 | 
				
			||||||
// noinspection JSAnnotator
 | 
					// noinspection JSAnnotator
 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__ = __REDUX_DEVTOOLS_EXTENSION__ as any;
 | 
					window.__REDUX_DEVTOOLS_EXTENSION__ = __REDUX_DEVTOOLS_EXTENSION__ as any;
 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__.open = openWindow;
 | 
					window.__REDUX_DEVTOOLS_EXTENSION__.open = openWindow;
 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__.updateStore = updateStore(stores);
 | 
					 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__.notifyErrors = notifyErrors;
 | 
					window.__REDUX_DEVTOOLS_EXTENSION__.notifyErrors = notifyErrors;
 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__.send = sendMessage;
 | 
					window.__REDUX_DEVTOOLS_EXTENSION__.send = sendMessage;
 | 
				
			||||||
window.__REDUX_DEVTOOLS_EXTENSION__.listen = setListener;
 | 
					window.__REDUX_DEVTOOLS_EXTENSION__.listen = setListener;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user