ReadableStream.locked

The locked read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.

Syntax

var locked = readableStream.locked;

Value

A boolean value indicating whether or not the readable stream is locked.

Examples

const stream = new ReadableStream({
  ...
});

const reader = stream.getReader();

stream.locked
// should return true, as the stream has been locked to a reader

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
locked
43
14
65
No
30
10.1
43
43
65
30
10.3
4.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/locked