git.iko.soy/typeable/reflex-dom-contrib
on master help sign in
ad alertEvents, fix README
commita78320a5f820e9632ccdbbe180049012e603d957 authorMarisa Kirisame <lolisa@marisa.moe> dateWed 22 Aug 2018, 10:52 (8 years ago) parentd75fcd5
2 files changed+11−1
README.md+1−1 src/Reflex/Dom/Contrib/Utils.hs+10
README.md+1−1
@@ -24,7 +24,7 @@ repository](https://github.com/reflex-frp/reflex-platform). Assuming you cloned
2424in your home directory you can then do this:
2525
2626 cd path/to/reflex-dom-contrib
27− ~/reflex-platform/work-on ghcjs ./.
27+ ~/reflex-platform/scripts/work-on ghcjs ./.
2828
2929That will put you in a nix-shell with the necessary environment. Then you can
3030build like this:
src/Reflex/Dom/Contrib/Utils.hs+10
@@ -58,6 +58,16 @@ alertEvent str e = do
5858 Just window <- currentWindow
5959 performEvent_ (DOM.alert window . str <$> e)
6060
61+------------------------------------------------------------------------------
62+-- | Convenient function that pops up multiple javascript alert dialog box
63+-- sequentially when an event fires with messages to display.
64+alertEvents
65+ :: (PerformEvent t m, MonadJSM m, MonadJSM (Performable m))
66+ => (a -> [String]) -> Event t a -> m ()
67+alertEvents str e = do
68+ Just window <- currentWindow
69+ performEvent_ (mapM_ (DOM.alert window) <$> str <$> e)
70+
6171------------------------------------------------------------------------------
6272-- | Convenient function that pops up a javascript confirmation dialog box
6373-- when an event fires with a message to display.