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

orr stalls the view when using AVars #32

Open
sloosch opened this issue Oct 22, 2019 · 1 comment
Open

orr stalls the view when using AVars #32

sloosch opened this issue Oct 22, 2019 · 1 comment
Assignees

Comments

@sloosch
Copy link

sloosch commented Oct 22, 2019

Hi!

Having this minimal example and using the current master

module Main where

import Prelude

import Concur.React.DOM as D
import Concur.React.Run (runWidgetInDom)
import Control.MultiAlternative (orr)
import Debug.Trace (traceM)
import Effect (Effect)
import Effect.Aff.AVar as AVar
import Effect.Aff.Class (liftAff)

main :: Effect Unit
main = do
  runWidgetInDom "main" do
    avar <- liftAff $ AVar.empty
    text <- orr [liftAff $ AVar.take avar, (liftAff $ AVar.put "hello" avar) *> D.text "old view"]
    traceM text
    D.text text

does output the correct console log (traceM) but still displays the old view.
The problem can be "fixed" by

  • Adding pulse to the take widget, which feels arbitrary
  • Making the take widget the last in orr, which does destroy the order in the view

I've looked into the code and found a reference to #16 which seems like a similar issue.

@ajnsit ajnsit self-assigned this Oct 22, 2019
@ajnsit
Copy link
Member

ajnsit commented Oct 22, 2019

Thanks for the report! I'm looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants