Permalink
Browse files

distribute fake clicks upon refresh

  • Loading branch information...
1 parent 76b0528 commit d9869178572fea88da0714de2ad7350441816605 @gelisam committed Jul 12, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 Main.hs
View
@@ -30,11 +30,17 @@ reactiveMain :: forall t. Frameworks t
-> Moment t (Behavior t Picture)
reactiveMain floats events = return pictures
where
+ refreshClicks :: Event t ()
+ refreshClicks = buttonClick extentR events
+
buttonClicks :: [Event t ()]
buttonClicks = map (flip buttonClick events) buttons
+ fakeButtonClicks :: [Event t ()]
+ fakeButtonClicks = map (union refreshClicks) buttonClicks
+
labelledClicks :: [Event t Char]
- labelledClicks = zipWith (fmap . const) ['a'..] buttonClicks
+ labelledClicks = zipWith (fmap . const) ['a'..] fakeButtonClicks
clickLabels :: Event t Char
clickLabels = foldr union never labelledClicks

0 comments on commit d986917

Please sign in to comment.