()
| 98 | } |
| 99 | |
| 100 | close(): void { |
| 101 | if (this.readyState === EventSource.CLOSED) { |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | this.readyState = FetchEventSource.CLOSED; |
| 106 | this.controller?.abort(); |
| 107 | this.reader?.cancel().catch(() => { |
| 108 | // Ignore cancel errors |
| 109 | }); |
| 110 | this.reader = null; |
| 111 | this.controller = null; |
| 112 | } |
| 113 | |
| 114 | private async connect(headers?: Record<string, string>): Promise<void> { |
| 115 | if (this.readyState === EventSource.CLOSED) { |
no test coverage detected