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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
locked | Chrome Full support 43 | Edge Full support 14 | Firefox
Full support
65
| IE No support No | Opera Full support 30 | Safari Full support 10.1 | WebView Android Full support 43 | Chrome Android Full support 43 | Firefox Android
Full support
65
| Opera Android Full support 30 | Safari iOS Full support 10.3 | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
- User must explicitly enable this feature.