Safe Haskell | None |
---|---|
Language | Haskell2010 |
Misc reflex-dom helper functions.
- alertEvent :: MonadWidget t m => (a -> String) -> Event t a -> m ()
- js_alert :: JSString -> IO ()
- confirmEvent :: MonadWidget t m => (a -> String) -> Event t a -> m (Event t a)
- js_confirm :: JSString -> IO Bool
- getWindowLocationPath :: Window -> IO String
- windowHistoryPushState :: String -> IO ()
- setWindowLoc :: String -> IO ()
- widgetHoldHelper :: MonadWidget t m => (a -> m b) -> a -> Event t a -> m (Dynamic t b)
- putDebugLn :: MonadWidget t m => String -> m ()
- putDebugLnE :: MonadWidget t m => Event t a -> (a -> String) -> m ()
- listWithKeyAndSelection :: forall t m k v a. (MonadWidget t m, Ord k) => Dynamic t k -> Dynamic t (Map k v) -> (k -> Dynamic t v -> Dynamic t Bool -> m a) -> m (Dynamic t (Map k a))
- waitUntilJust :: IO (Maybe a) -> IO a
Documentation
alertEvent :: MonadWidget t m => (a -> String) -> Event t a -> m () Source
Convenient function that pops up a javascript alert dialog box when an event fires with a message to display.
confirmEvent :: MonadWidget t m => (a -> String) -> Event t a -> m (Event t a) Source
Convenient function that pops up a javascript confirmation dialog box when an event fires with a message to display.
js_confirm :: JSString -> IO Bool Source
getWindowLocationPath :: Window -> IO String Source
Gets the current path of the DOM Window (i.e., the contents of the address bar after the host, beginning with a "/"). https://developer.mozilla.org/en-US/docs/Web/API/Location
windowHistoryPushState :: String -> IO () Source
Pushes a new URL to the window history.
setWindowLoc :: String -> IO () Source
widgetHoldHelper :: MonadWidget t m => (a -> m b) -> a -> Event t a -> m (Dynamic t b) Source
A common form for widgetHold calls that mirrors the pattern seen in hold and holdDyn.
putDebugLn :: MonadWidget t m => String -> m () Source
Simple debug function that prints a message on postBuild.
putDebugLnE :: MonadWidget t m => Event t a -> (a -> String) -> m () Source
Prints a string when an event fires. This differs slightly from traceEvent because it will print even if the event is otherwise unused.
listWithKeyAndSelection :: forall t m k v a. (MonadWidget t m, Ord k) => Dynamic t k -> Dynamic t (Map k v) -> (k -> Dynamic t v -> Dynamic t Bool -> m a) -> m (Dynamic t (Map k a)) Source
A generalized version of the one in reflex-dom.
waitUntilJust :: IO (Maybe a) -> IO a Source
Simple utility function to robustly get things like the current window, DOM document, document body, etc.