Skip to content

Disconnecting specific store instances #1370

@PrettyCoffee

Description

@PrettyCoffee

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions