feat: add devtools.cleanup() method#3111
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
This sounds reasonable to me. Can anyone give a deep review? |
|
@dbritto-dev What do you think? |
|
@dai-shi LGTM but up to you |
dai-shi
left a comment
There was a problem hiding this comment.
I had a closer look, but it looks good.
One concern, which is not this PR's fault, is that the code around connection info isn't very readable. It took me while to get it.
We would like to refactor in the future, and for that, can you add a test that depends on removeStoreFromTrackedConnections?
@dai-shi Do you have any suggestions for how to test this functionality properly? |
|
Actually, I don't. Actually, I have an idea. If we fail to remove from tracked connections, |
Here's the updated patch: 383d932. Let me know if anything needs to be adjusted! |
dai-shi
left a comment
There was a problem hiding this comment.
LGTM
Thanks for your contribution!
|
@dai-shi I'll take care of docs |
Summary
When a store is wrapped in a context provider, remounting can cause duplicate instances in Redux DevTools; this patch adds a
devtools.cleanup()method, allowing users to manually unsubscribe and clean up tracked connections.Check List
pnpm run fixfor formatting and linting code and docsNote
related to #2254