caolan / caolan/highland

I can write to stream which is ended.

Open
#217 8 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3.4k
Forks
145
PR merge metrics
No merged PRs in 30d

Description

Should I be able to write to the stream which has ended?
If I do:

```
var one = H([1, 2, 3]);
one.consume(function (err, x, push, next) {
if (x === H.nil) {
console.log('Nil')
} else {
console.log(x);
}
next();
}).each(H.log);
one.write(4); //throw expected here, but it does not happen.
//Output is: [1, 2, 3, Nil, 4]
```

Contributor guide

Open the contributing guide

Research direction

Start by running the reproduction using H([1, 2, 3]), consume, and write(4), and observe the output after H.nil. Trace the stream lifecycle around consume, the ended state, and write to determine the intended behavior. Done means the behavior of writing after the stream ends is defined and covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.