reduxjs / redux-devtools

DevTools for Redux with hot reloading, action replay, and customizable UI
http://youtube.com/watch?v=xsSnOQynTHs
MIT License
14.07k stars 1.17k forks source link

Disconnecting specific store instances #1370

Open PrettyCoffee opened 1 year ago

PrettyCoffee commented 1 year ago

Hello! When having multiples store instances in one tab, how would you disconnect a single one?

The only disconnect function I found in the documentation is window.__REDUX_DEVTOOLS_EXTENSION__.disconnect() which disconnects all store instances at once.

Example:

const connectionA = window.__REDUX_DEVTOOLS_EXTENSION__.connect({name: "store a"})
connectionA.init("value1") 

const connectionB = window.__REDUX_DEVTOOLS_EXTENSION__.connect({name: "store b"})
connectionB.init("value2")

When calling window.__REDUX_DEVTOOLS_EXTENSION__.disconnect() this would disconnect all stores.

Is there something like connectionA.disconnect() or window.__REDUX_DEVTOOLS_EXTENSION__.disconnect(connectionA) to only disconnect one and removing it from the instances dropdown? image

I also found connectionA.unsubscribe(), but it only removes the listeners applied with connectionA.subscribe(), but not remove it from the instances dropdown in the extension.

If it's not a feature yet, is it planned to introduce something like that?

piskunovim commented 1 year ago

As I see the problem is related to https://github.com/reduxjs/redux-devtools/issues/366. But no answer so far. I also have interest in this topic.