mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 09:36:43 +03:00
LogMonitor now attempts to call .toJS() on state entries.
This commit is contained in:
parent
b09d171f2d
commit
634b8e8557
|
@ -144,6 +144,20 @@ export default class LogMonitor {
|
||||||
const action = stagedActions[i];
|
const action = stagedActions[i];
|
||||||
const { state, error } = computedStates[i];
|
const { state, error } = computedStates[i];
|
||||||
let previousState;
|
let previousState;
|
||||||
|
|
||||||
|
const readableState = {};
|
||||||
|
for (const prop in state) {
|
||||||
|
if (
|
||||||
|
state.hasOwnProperty(prop) &&
|
||||||
|
typeof state[prop] === 'object' &&
|
||||||
|
typeof state[prop].toJS === 'function'
|
||||||
|
) {
|
||||||
|
readableState = state[prop].toJS();
|
||||||
|
} else {
|
||||||
|
readableState = state[prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
previousState = computedStates[i - 1].state;
|
previousState = computedStates[i - 1].state;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +167,7 @@ export default class LogMonitor {
|
||||||
theme={theme}
|
theme={theme}
|
||||||
select={select}
|
select={select}
|
||||||
action={action}
|
action={action}
|
||||||
state={state}
|
state={readableState}
|
||||||
previousState={previousState}
|
previousState={previousState}
|
||||||
collapsed={skippedActions[i]}
|
collapsed={skippedActions[i]}
|
||||||
error={error}
|
error={error}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user