mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
stash
This commit is contained in:
parent
185e760ec3
commit
480b7a4201
|
@ -35,6 +35,7 @@ import {
|
|||
SUBSCRIBE_SUCCESS,
|
||||
UNSUBSCRIBE,
|
||||
} from '../constants/socketActionTypes';
|
||||
import { Action } from 'redux';
|
||||
|
||||
let monitorReducer;
|
||||
let monitorProps = {};
|
||||
|
@ -65,7 +66,18 @@ export function changeTheme(data: ChangeThemeData): ChangeThemeAction {
|
|||
return { type: CHANGE_THEME, ...data.formData };
|
||||
}
|
||||
|
||||
export function liftedDispatch(action) {
|
||||
interface MonitorActionAction {
|
||||
type: typeof MONITOR_ACTION;
|
||||
action: Action<unknown>;
|
||||
}
|
||||
interface LiftedActionAction {
|
||||
type: typeof LIFTED_ACTION;
|
||||
message: 'DISPATCH';
|
||||
action: Action<unknown>;
|
||||
}
|
||||
export function liftedDispatch(
|
||||
action: Action<unknown>
|
||||
): MonitorActionAction | LiftedActionAction {
|
||||
if (action.type[0] === '@') {
|
||||
if (action.type === '@@INIT_MONITOR') {
|
||||
monitorReducer = action.update;
|
||||
|
@ -289,6 +301,8 @@ interface UnsubscribeAction {
|
|||
export type StoreAction =
|
||||
| ChangeSectionAction
|
||||
| ChangeThemeAction
|
||||
| MonitorActionAction
|
||||
| LiftedActionAction
|
||||
| SelectInstanceAction
|
||||
| SelectMonitorAction
|
||||
| UpdateMonitorStateAction
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ActionCreators } from 'redux-devtools-instrument';
|
||||
import { ActionCreators, LiftedAction } from 'redux-devtools-instrument';
|
||||
import { Button, Toolbar, Divider } from 'devui';
|
||||
import RecordButton from './buttons/RecordButton';
|
||||
import PersistButton from './buttons/PersistButton';
|
||||
import LockButton from './buttons/LockButton';
|
||||
import InstanceSelector from './InstanceSelector';
|
||||
import SyncButton from './buttons/SyncButton';
|
||||
import { Action } from 'redux';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { reset, rollback, commit, sweep } = ActionCreators;
|
||||
|
||||
export default class TopButtons extends Component {
|
||||
interface Props {
|
||||
dispatch: (action: LiftedAction<unknown, Action<unknown>, unknown>) => void;
|
||||
}
|
||||
|
||||
export default class TopButtons extends Component<Props> {
|
||||
static propTypes = {
|
||||
// shouldSync: PropTypes.bool,
|
||||
liftedState: PropTypes.object.isRequired,
|
||||
|
@ -18,7 +24,7 @@ export default class TopButtons extends Component {
|
|||
options: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
shouldComponentUpdate(nextProps: Props) {
|
||||
return (
|
||||
nextProps.options !== this.props.options ||
|
||||
nextProps.liftedState !== this.props.liftedState
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { connect, ResolveThunks } from 'react-redux';
|
||||
import { Container } from 'devui';
|
||||
import SliderMonitor from './monitors/Slider';
|
||||
import { liftedDispatch as liftedDispatchAction, getReport } from '../actions';
|
||||
|
@ -11,7 +11,11 @@ import TopButtons from '../components/TopButtons';
|
|||
import BottomButtons from '../components/BottomButtons';
|
||||
import { StoreState } from '../reducers';
|
||||
|
||||
class Actions extends Component {
|
||||
type StateProps = ReturnType<typeof mapStateToProps>;
|
||||
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
||||
type Props = StateProps & DispatchProps;
|
||||
|
||||
class Actions extends Component<Props> {
|
||||
render() {
|
||||
const {
|
||||
monitor,
|
||||
|
|
|
@ -2,10 +2,10 @@ import { combineReducers } from 'redux';
|
|||
import section, { SectionState } from './section';
|
||||
import connection, { ConnectionState } from './connection';
|
||||
import socket, { SocketState } from './socket';
|
||||
import monitor from './monitor';
|
||||
import monitor, { MonitorState } from './monitor';
|
||||
import notification, { NotificationState } from './notification';
|
||||
import instances from './instances';
|
||||
import reports from './reports';
|
||||
import instances, { InstancesState } from './instances';
|
||||
import reports, { ReportsState } from './reports';
|
||||
import theme, { ThemeState } from './theme';
|
||||
import { StoreAction } from '../actions';
|
||||
|
||||
|
@ -14,6 +14,9 @@ export interface StoreState {
|
|||
readonly theme: ThemeState;
|
||||
readonly connection: ConnectionState;
|
||||
readonly socket: SocketState;
|
||||
readonly monitor: MonitorState;
|
||||
readonly instances: InstancesState;
|
||||
readonly reports: ReportsState;
|
||||
readonly notification: NotificationState;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import parseJSON from '../utils/parseJSON';
|
|||
import { recompute } from '../utils/updateState';
|
||||
import { StoreAction } from '../actions';
|
||||
|
||||
interface InstancesState {
|
||||
export interface InstancesState {
|
||||
sync: boolean;
|
||||
persisted?: boolean;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import {
|
|||
} from '../constants/actionTypes';
|
||||
import { StoreAction } from '../actions';
|
||||
|
||||
export interface MonitorState {}
|
||||
|
||||
const initialState = {
|
||||
selected: 'InspectorMonitor',
|
||||
monitorState: undefined,
|
||||
|
|
|
@ -3,6 +3,8 @@ import {
|
|||
} from '../constants/actionTypes';
|
||||
import { StoreAction } from '../actions';
|
||||
|
||||
export interface ReportsState {}
|
||||
|
||||
const initialState = {
|
||||
data: [],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user