Skip to content

Commit 976e89d

Browse files
committed
Add eventjoin
1 parent 59ef31e commit 976e89d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Reflex/Class.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module Reflex.Class
6363
, factorEvent
6464
, filterEventKey
6565
-- ** Collapsing 'Event . Event'
66+
, eventJoin
6667
, switchHold
6768
, switchHoldPromptly
6869
, switchHoldPromptOnly
@@ -817,6 +818,10 @@ fanThese e =
817818
fanMap :: (Reflex t, Ord k) => Event t (Map k a) -> EventSelector t (Const2 k a)
818819
fanMap = fan . fmap mapToDMap
819820

821+
-- | switcHold never = eventjoin
822+
eventJoin :: (Reflex t, MonadHold t m) => Event t (Event t a) -> m (Event t a)
823+
eventJoin = switchHold never
824+
820825
-- | Switches to the new event whenever it receives one. Only the old event is
821826
-- considered the moment a new one is switched in; the output event will fire at
822827
-- that moment if only if the old event does.

0 commit comments

Comments
 (0)