Skip to content

Commit e458311

Browse files
committed
doc: remove assignment in condition in stream doc
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.
1 parent 2b0d61f commit e458311

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/stream.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,10 +1033,11 @@ available, [`stream.read()`][stream-read] will return that data.
10331033
const readable = getReadableStreamSomehow();
10341034
readable.on('readable', function() {
10351035
// There is some data to read now.
1036-
let data;
1036+
let data = this.read();
10371037

1038-
while (data = this.read()) {
1038+
while (data) {
10391039
console.log(data);
1040+
data = this.read();
10401041
}
10411042
});
10421043
```

0 commit comments

Comments
 (0)