2{-# LANGUAGE MultiParamTypeClasses #-}
3#ifdef USE_REFLEX_OPTIMIZER
4{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
13import Reflex.NotReady.Class
14import Reflex.PostBuild.Class
16-- | Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
17-- The returned Event of network results occurs when the Dynamic does.
18-- Note: Often, the type 'a' is an Event, in which case the return value is an Event-of-Events that would typically be flattened (via 'switchPromptly').
19networkView :: (NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
21 postBuild <- getPostBuild
22 let newChild = leftmost [updated child, tagCheap (current child) postBuild]
23 snd <$> runWithReplace notReady newChild
25-- | Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the Event fires.
26-- The returned Dynamic of network results occurs when the Event does.
27-- Note: Often, the type 'a' is an Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
28networkHold :: (Adjustable t m, MonadHold t m) => m a -> Event t (m a) -> m (Dynamic t a)
29networkHold child0 newChild = do
30 (result0, newResult) <- runWithReplace child0 newChild
31 holdDyn result0 newResult
33-- | Render a placeholder network to be shown while another network is not yet
35untilReady :: (Adjustable t m, PostBuild t m) => m a -> m b -> m (a, Event t b)
37 postBuild <- getPostBuild
38 runWithReplace a $ b <$ postBuild
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list