Skip to content

Commit 23b74aa

Browse files
authored
Make fetch/DecompressionStream usage more canonical. (#507)
The `body` property of a `Response` from `fetch` is a stream.
1 parent 719ac60 commit 23b74aa

File tree

1 file changed

+1
-4
lines changed
  • sample/volumeRenderingTexture3D

1 file changed

+1
-4
lines changed

sample/volumeRenderingTexture3D/main.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,10 @@ async function createVolumeTexture(format: GPUTextureFormat) {
158158
});
159159

160160
const response = await fetch(dataPath);
161-
const compressedBlob = await response.blob();
162161

163162
// Decompress the data using DecompressionStream for gzip format
164163
const decompressionStream = new DecompressionStream('gzip');
165-
const decompressedStream = compressedBlob
166-
.stream()
167-
.pipeThrough(decompressionStream);
164+
const decompressedStream = response.body.pipeThrough(decompressionStream);
168165
const decompressedArrayBuffer = await new Response(
169166
decompressedStream
170167
).arrayBuffer();

0 commit comments

Comments
 (0)