MithrilJS / MithrilJS/mithril.js
Dependent streams should end when their parent ends
Open
Nobody has claimed this yet.
Type: Breaking Change
Type: Bug
- Dominant language
- JavaScript
- Stars
- 14.5k
- Forks
- 922
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behavior
const s = Stream()
const c = stream.map(a => a)
s.end.map(() => console.log('parent ended'))
c.end.map(() => console.log('child ended'))
stream.end(true) // logs "parent ended" and "child ended"
Current Behavior
const s = Stream()
const c = stream.map(a => a)
s.end.map(() => console.log('parent ended'))
c.end.map(() => console.log('child ended'))
stream.end(true) // logs just "parent ended"
Possible Solution
Potentially something down the vein of this comment by @pygy, but it may need altered.
Context
I created this issue to track the issue reported in #2030 (a heavily outdated PR targeting the wrong branch).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the stream behavior shown in the expected and current examples, then read the discussion linked from issue #2030 and its referenced pull request comment. Done means ending the parent stream also triggers the child stream's end notification, while preserving the parent notification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100