()
| 170 | } |
| 171 | } |
| 172 | start() { |
| 173 | this.debugLog('Starting client event bus') |
| 174 | if (typeof window === 'undefined') { |
| 175 | return |
| 176 | } |
| 177 | if (this.#connectToServerBus) { |
| 178 | this.connect() |
| 179 | } |
| 180 | this.#eventTarget = window |
| 181 | this.#eventTarget.addEventListener( |
| 182 | 'tanstack-dispatch-event', |
| 183 | this.#dispatcher, |
| 184 | ) |
| 185 | this.#eventTarget.addEventListener( |
| 186 | 'tanstack-connect', |
| 187 | this.#connectFunction, |
| 188 | ) |
| 189 | } |
| 190 | stop() { |
| 191 | this.debugLog('Stopping client event bus') |
| 192 | if (typeof window === 'undefined') { |
no test coverage detected