mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-04-16 22:41:59 +03:00
Add socket to panelStore
This commit is contained in:
parent
20b575a0b1
commit
26f38527eb
|
@ -6,6 +6,7 @@ import { Persistor } from 'redux-persist';
|
|||
import {
|
||||
REMOVE_INSTANCE,
|
||||
StoreAction,
|
||||
StoreState,
|
||||
UPDATE_STATE,
|
||||
} from '@redux-devtools/app';
|
||||
import App from '../app/App';
|
||||
|
@ -18,7 +19,6 @@ import {
|
|||
SplitUpdateStateRequest,
|
||||
UpdateStateRequest,
|
||||
} from '../background/store/apiMiddleware';
|
||||
import type { StoreStateWithoutSocket } from './store/panelReducer';
|
||||
import { PersistGate } from 'redux-persist/integration/react';
|
||||
|
||||
const position = location.hash;
|
||||
|
@ -31,7 +31,7 @@ const messageStyle: CSSProperties = {
|
|||
|
||||
let rendered: boolean | undefined;
|
||||
let currentRoot: Root | undefined;
|
||||
let store: Store<StoreStateWithoutSocket, StoreAction> | undefined;
|
||||
let store: Store<StoreState, StoreAction> | undefined;
|
||||
let persistor: Persistor | undefined;
|
||||
let bgConnection: chrome.runtime.Port;
|
||||
let naTimeout: NodeJS.Timeout;
|
||||
|
|
|
@ -1,45 +1,29 @@
|
|||
import { combineReducers, Reducer } from 'redux';
|
||||
import {
|
||||
connection,
|
||||
ConnectionState,
|
||||
instances,
|
||||
InstancesState,
|
||||
monitor,
|
||||
MonitorState,
|
||||
notification,
|
||||
NotificationState,
|
||||
reports,
|
||||
ReportsState,
|
||||
section,
|
||||
SectionState,
|
||||
StateTreeSettings,
|
||||
socket,
|
||||
stateTreeSettings,
|
||||
StoreAction,
|
||||
StoreState,
|
||||
theme,
|
||||
ThemeState,
|
||||
} from '@redux-devtools/app';
|
||||
|
||||
export interface StoreStateWithoutSocket {
|
||||
readonly section: SectionState;
|
||||
readonly theme: ThemeState;
|
||||
readonly connection: ConnectionState;
|
||||
readonly monitor: MonitorState;
|
||||
readonly instances: InstancesState;
|
||||
readonly reports: ReportsState;
|
||||
readonly notification: NotificationState;
|
||||
readonly stateTreeSettings: StateTreeSettings;
|
||||
}
|
||||
|
||||
const rootReducer: Reducer<
|
||||
StoreStateWithoutSocket,
|
||||
StoreState,
|
||||
StoreAction,
|
||||
Partial<StoreStateWithoutSocket>
|
||||
Partial<StoreState>
|
||||
> = combineReducers({
|
||||
instances,
|
||||
monitor,
|
||||
reports,
|
||||
notification,
|
||||
section,
|
||||
socket,
|
||||
theme,
|
||||
connection,
|
||||
stateTreeSettings,
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import { createStore, applyMiddleware, Reducer, Store } from 'redux';
|
||||
import localForage from 'localforage';
|
||||
import { persistReducer, persistStore } from 'redux-persist';
|
||||
import { exportStateMiddleware, StoreAction } from '@redux-devtools/app';
|
||||
import {
|
||||
exportStateMiddleware,
|
||||
StoreAction,
|
||||
StoreState,
|
||||
} from '@redux-devtools/app';
|
||||
import panelDispatcher from './panelSyncMiddleware';
|
||||
import rootReducer, { StoreStateWithoutSocket } from './panelReducer';
|
||||
import rootReducer from './panelReducer';
|
||||
|
||||
const persistConfig = {
|
||||
key: 'redux-devtools',
|
||||
|
@ -11,8 +15,10 @@ const persistConfig = {
|
|||
storage: localForage,
|
||||
};
|
||||
|
||||
const persistedReducer: Reducer<StoreStateWithoutSocket, StoreAction> =
|
||||
persistReducer(persistConfig, rootReducer) as any;
|
||||
const persistedReducer: Reducer<StoreState, StoreAction> = persistReducer(
|
||||
persistConfig,
|
||||
rootReducer,
|
||||
) as any;
|
||||
|
||||
export default function configureStore(
|
||||
position: string,
|
||||
|
|
Loading…
Reference in New Issue
Block a user