()
| 385 | * Returns an unsubscribe function. Calling it removes the handler. |
| 386 | */ |
| 387 | onConnected(handler: () => void): () => void { |
| 388 | this.connectedHandlers.add(handler); |
| 389 | if (this.isConnected()) { |
| 390 | handler(); |
| 391 | } |
| 392 | return () => { |
| 393 | this.connectedHandlers.delete(handler); |
| 394 | }; |
| 395 | } |
| 396 | |
| 397 | /** |
no test coverage detected