mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 19:13:56 +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 { state, error } = computedStates[i];
|
||||
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) {
|
||||
previousState = computedStates[i - 1].state;
|
||||
}
|
||||
|
@ -153,7 +167,7 @@ export default class LogMonitor {
|
|||
theme={theme}
|
||||
select={select}
|
||||
action={action}
|
||||
state={state}
|
||||
state={readableState}
|
||||
previousState={previousState}
|
||||
collapsed={skippedActions[i]}
|
||||
error={error}
|
||||
|
|
Loading…
Reference in New Issue
Block a user