const queuingStrategy = new ByteLengthQueuingStrategy({ highWaterMark: 1 });
const readableStream = new ReadableStream(
{
start(controller) {
// …
},
pull(controller) {
// …
},
cancel(err) {
console.log("stream error:", err);
},
},
queuingStrategy,
);
const size = queuingStrategy.size(chunk);ByteLengthQueuingStrategy: size() method / notebook
ByteLengthQueuingStrategy: size() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.