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
maybeWidget :: (DomBuilder t m, MonadFix m, MonadHold t m)
=> m b
-> (Dynamic t a -> m b)
-> Dynamic t (Maybe a)
-> m (Dynamic t (m b))
maybeWidget handleNothing handleJust dynMaybe =
(fmap . fmap) (maybe handleNothing handleJust) $ maybeDyn dynMaybe
It's analogous to the maybe function in that it allows a Dynamic t (Maybe a) to dynamically switch between widgets depending on whether that maybe is a Nothing or a Just. I typically use it with dyn and switchEvent from reflex-frp/reflex#49
The text was updated successfully, but these errors were encountered:
I find this helper function useful:
maybeWidget :: (DomBuilder t m, MonadFix m, MonadHold t m)
=> m b
-> (Dynamic t a -> m b)
-> Dynamic t (Maybe a)
-> m (Dynamic t (m b))
maybeWidget handleNothing handleJust dynMaybe =
(fmap . fmap) (maybe handleNothing handleJust) $ maybeDyn dynMaybe
It's analogous to the maybe function in that it allows a Dynamic t (Maybe a) to dynamically switch between widgets depending on whether that maybe is a Nothing or a Just. I typically use it with dyn and switchEvent from reflex-frp/reflex#49
The text was updated successfully, but these errors were encountered: