You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
moduleTest.IssuewhereimportPreludeimportControl.Monad.Eff (Eff)
importControl.Monad.Eff.Console (CONSOLE, log)
importFRP (FRP)
importFRP.Behavior (Behavior, sample_, switcher)
importFRP.Event (Event, subscribe)
importFRP.Event.Mouse (down)
importFRP.Event.Time (interval)
main∷∀e. Eff (console∷CONSOLE, frp∷FRP | e) Unit
main = do
_ ← subscribe badStream $ log <<< show
pure unit
testStream∷Event (BehaviorInt) -- stream of behaviors
testStream = pure <$> down
behavior∷BehaviorInt
behavior = switcher (pure 0) testStream
badStream∷EventInt
badStream = sample_ behavior (interval 1000)
Problem: badStream here fires only a second after last mouse down event. So if for ex. testStream would fire more often than once per second, badStream will never fire.
Expected behavior: badStream should tick exactly once per second, regardless of testStream.
The text was updated successfully, but these errors were encountered:
The problem seems to be with interval, which sets up a new timer for each subscription. It sounds like you want an "always on" event whose subscription exists outside of the event network. You could try creating such an event using the FFI, to see if that solves the problem. If it does, I will think about if/how this can fit into the semantics.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem: badStream here fires only a second after last mouse down event. So if for ex. testStream would fire more often than once per second, badStream will never fire.
Expected behavior: badStream should tick exactly once per second, regardless of testStream.
The text was updated successfully, but these errors were encountered: