• Wire a Graph to the Redux DevTools Extension and return a disposer.

    Parameters

    Returns Unsubscribe

    A disposer that decrements the per-graph refcount and runs the actual cleanup on the last release. Idempotent — calling the disposer twice is a no-op (#238).

    When __REDUX_DEVTOOLS_EXTENSION__ is undefined this returns an inert shared no-op without allocating the connection, the handler table, or the bridge state. The zero-cost gate test asserts no observable side-effects in that path.

    Under React StrictMode the host calls connectDevtools(g) twice in the same effect cycle (mount → cleanup → mount) and may also have two live mounts overlapping for the same graph instance. Both cases share a single underlying panel connection via ACTIVE (#238).