Skip to content

Commit

Permalink
doc: remove assignment in condition in stream doc
Browse files Browse the repository at this point in the history
This is part of an effort to get our code to comply with ESLint
no-cond-assign so that we don't have to disable that rule in our config.
  • Loading branch information
Trott committed Jan 14, 2022
1 parent 2b0d61f commit e458311
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,11 @@ available, [`stream.read()`][stream-read] will return that data.
const readable = getReadableStreamSomehow();
readable.on('readable', function() {
// There is some data to read now.
let data;
let data = this.read();

while (data = this.read()) {
while (data) {
console.log(data);
data = this.read();
}
});
```
Expand Down

0 comments on commit e458311

Please sign in to comment.