You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a game using redux. The game has its own run loop that dispatches a TICK action inside a requestAnimationFrame loop, so I was planning to use this component to filter that action.
I was surprised to see that when I triggered a non-tick action, causing an entry to display in the devtools monitor, the state that was reported seemed to be stale, as if it was computed from one of the first tick actions. Investigating the source of redux-devtools-log-monitor and redux-devtools-filter-actions, I quickly saw the problem:
In FilterMonitor.js, the stagedActionIds array is filtered to remove blacklisted/include whitelisted actions.
In LogMonitor.js, the stagedActionIds array is iterated over. The index of this iteration is used to look up the corresponding state from the computedStates passed from redux-devtools. However, computedStates contains all of the computed states, including blacklisted actions, meaning there's no way that this lookup will align with the filtered action IDs!
I'm not sure what the fix here is. I don't currently see any way to look up the correct computedState without having the index of the action. Maybe a map of action ID to state could be added to the props passed down from redux-devtools? A map of action ID to original index could also work.
The text was updated successfully, but these errors were encountered:
Your solution is the same as it was here before extending it to a wrap monitor. The reason we switched from that is to support different monitors and to have new versions of log monitor supported without maintaining a fork.
I figure filtering computedStates along with stagedActionIds will solve it.
I'm working on a game using redux. The game has its own run loop that dispatches a
TICK
action inside arequestAnimationFrame
loop, so I was planning to use this component to filter that action.I was surprised to see that when I triggered a non-tick action, causing an entry to display in the devtools monitor, the state that was reported seemed to be stale, as if it was computed from one of the first tick actions. Investigating the source of
redux-devtools-log-monitor
andredux-devtools-filter-actions
, I quickly saw the problem:stagedActionIds
array is filtered to remove blacklisted/include whitelisted actions.stagedActionIds
array is iterated over. The index of this iteration is used to look up the corresponding state from thecomputedStates
passed from redux-devtools. However,computedStates
contains all of the computed states, including blacklisted actions, meaning there's no way that this lookup will align with the filtered action IDs!I'm not sure what the fix here is. I don't currently see any way to look up the correct
computedState
without having the index of the action. Maybe a map of action ID to state could be added to the props passed down from redux-devtools? A map of action ID to original index could also work.The text was updated successfully, but these errors were encountered: