(file, decoder)
| 156 | } |
| 157 | |
| 158 | async _streamFile(file, decoder) { |
| 159 | const stream = file.stream().pipeThrough(new decoder()); |
| 160 | const reader = stream.getReader(); |
| 161 | let chunk, readerDone; |
| 162 | do { |
| 163 | const readResult = await reader.read(); |
| 164 | chunk = readResult.value; |
| 165 | readerDone = readResult.done; |
| 166 | if (!chunk) break; |
| 167 | this._handleFileChunk(chunk); |
| 168 | // Artificial delay to allow for layout updates. |
| 169 | await delay(5); |
| 170 | } while (!readerDone); |
| 171 | } |
| 172 | |
| 173 | _handleFileChunk(chunk) { |
| 174 | this.dispatchEvent(new CustomEvent('fileuploadchunk', { |
no test coverage detected