Filter redux devtools state in useAtomsDevtools #103
Closed
axel-havukangas-tt
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
Thanks for reaching out! Yes, we don't have first-class support for What you have is also a good workaround! By the way, we also have UI-based DevTools that come with this feature out-of-the-box. Have you tried that? This guide should help you get started |
Beta Was this translation helpful? Give feedback.
4 replies
-
Released in 0.7.0 🚀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using
useAtomsDevtools
with Redux DevTools is a really powerful combination that makes it easy and unintrusive to inspect the application state. The only issue I've been having is the amount of noise in the state browser caused by various internal atoms for example within theloadable
utility. Filtering out private atoms was hinted at in pmndrs/jotai#931 (comment), but not available at the moment.One possible partial solution would be to expose the
stateSanitize
configuration value when creating the redux devtool connection. Then developers could use that to filter out unwanted atoms from the state. Unfortunately thedebugPrivate
value of atoms isn't available in that context, so one is limited to thedebugLabel
. My solution has been to use ahidden
label for any atoms that I want to filter away in the devtools.My current workaround for this is to wrap the
window.__REDUX_DEVTOOLS_EXTENSION__.connect
function with my own. Like thisbut life would of course be nicer without the extra boilerplate.
Beta Was this translation helpful? Give feedback.
All reactions