()
| 188 | ) |
| 189 | } |
| 190 | stop() { |
| 191 | this.debugLog('Stopping client event bus') |
| 192 | if (typeof window === 'undefined') { |
| 193 | return |
| 194 | } |
| 195 | this.#eventTarget.removeEventListener( |
| 196 | 'tanstack-dispatch-event', |
| 197 | this.#dispatcher, |
| 198 | ) |
| 199 | this.#eventTarget.removeEventListener( |
| 200 | 'tanstack-connect', |
| 201 | this.#connectFunction, |
| 202 | ) |
| 203 | this.#eventSource?.close() |
| 204 | this.#socket?.close() |
| 205 | this.#socket = null |
| 206 | this.#eventSource = null |
| 207 | this.#pendingServerEvents = [] |
| 208 | } |
| 209 | private getGlobalTarget() { |
| 210 | if (typeof window !== 'undefined') { |
| 211 | return window |
no test coverage detected