MithrilJS / MithrilJS/mithril.js
mithril stream .map does not trigger next stream value
Open
@dead-claudia is already working on this.
Since Dec 13, 2020.
Area: Stream
Type: Bug
- Dominant language
- JavaScript
- Stars
- 14.5k
- Forks
- 922
- PR merge metrics
- No merged PRs in 30d
Description
Mithril version:
2.0.4
Browser and OS:
Chrome on Mac OSX
Project:
Steps to Reproduce
- Create an
updatestream - Create a
statesstream byscanning the `update stream - Call
states.map(state => effect(state)whereeffecttriggers anotherupdate
Expected Behavior
- Expect the
effectfunction to be called again - Here is a flems showing the expected behavior
- Notice the output on the console:
{ route: 'Home', routeChanged: true, data: [] }{ route: 'Home', routeChanged: false, data: [], loading: true }{ route: 'Home', routeChanged: false, data: [ 'duck', 'quack' ], loading: false }
Current Behavior
- The
effectfunction is not called again - Here is a flems showing the current behavior
- Notice the output on the console:
{ route: 'Home', routeChanged: true, data: [] }{ route: 'Home', routeChanged: false, data: [], loading: true }
- The third state is missing because the
effectfunction should have been called again, but it is not.
Context
This is to set up the Meiosis pattern with Effects.
Note: This commit fixes the same issue in Meiosis-Setup's simple-stream.
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.
Assessment
This issue has not been assessed yet.