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 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

Specification Status Comment
Streams
The definition of 'locked' in that specification.
Living Standard Initial definition.

Browser compatibility

BCD tables only load in the browser