Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mithril stream .map does not trigger next stream value #2643

Open
foxdonut opened this issue Dec 13, 2020 · 4 comments
Open

mithril stream .map does not trigger next stream value #2643

foxdonut opened this issue Dec 13, 2020 · 4 comments
Assignees
Labels
Area: Stream For anything dealing with Mithril streams Type: Bug For bugs and any other unexpected breakage

Comments

@foxdonut
Copy link

Mithril version:

2.0.4

Browser and OS:

Chrome on Mac OSX

Project:

Meiosis

Steps to Reproduce

  • Create an update stream
  • Create a states stream by scanning the `update stream
  • Call states.map(state => effect(state) where effect triggers another update

Expected Behavior

  • Expect the effect function 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 effect function 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 effect function 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.

@foxdonut foxdonut added the Type: Bug For bugs and any other unexpected breakage label Dec 13, 2020
@pygy
Copy link
Member

pygy commented Jan 16, 2021

@foxdonut have you investigated how to fix this?

@foxdonut
Copy link
Author

@pygy yes, see the last line of my description above, there is a link to a commit showing how I fixed it in simple-stream. I figure the fix should be similar in mithril stream.

@pygy
Copy link
Member

pygy commented Jan 16, 2021

Thanks, I'll have to dig into that then :-) (unless you beat me to a PR)

@ericop
Copy link

ericop commented Mar 19, 2021

@pygy here is a working flems based on @foxdonut example. I tried making a PR, but with other changes in the next branch were beyond my wizardry to make play nice together.

@dead-claudia dead-claudia moved this to Needs triage in Triage/bugs Sep 2, 2024
@dead-claudia dead-claudia added the Area: Stream For anything dealing with Mithril streams label Sep 2, 2024
@dead-claudia dead-claudia mentioned this issue Oct 13, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Stream For anything dealing with Mithril streams Type: Bug For bugs and any other unexpected breakage
Projects
Status: Needs triage
Development

No branches or pull requests

4 participants