on develop help sign in
Add emptyElWith and emptyElWith'
commit0dd4f0ed5c4481fc4eef3f7d6889c6cdfe63b9e1 authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 8 Aug 2016, 20:34 (10 years ago) parentd0f525e
1 file changed+8
src/Reflex/Dom/Old.hs+8
src/Reflex/Dom/Old.hs+8
@@ -19,6 +19,8 @@ module Reflex.Dom.Old
1919 , deleteBetweenExclusive
2020 , elWith
2121 , elWith'
22+ , emptyElWith
23+ , emptyElWith'
2224 , onEventName
2325 , schedulePostBuild
2426 , text'
@@ -164,3 +166,9 @@ elWith elementTag cfg child = snd <$> elWith' elementTag cfg child
164166
165167elWith' :: Attributes m attrs => Text -> ElConfig attrs -> m a -> m (DOM.HTMLElement, a)
166168elWith' elementTag cfg child = buildElementNS (cfg ^. namespace) elementTag (cfg ^. attributes) child
169+
170+emptyElWith :: (Monad m, Attributes m attrs) => Text -> ElConfig attrs -> m ()
171+emptyElWith elementTag cfg = void $ emptyElWith' elementTag cfg
172+
173+emptyElWith' :: (Monad m, Attributes m attrs) => Text -> ElConfig attrs -> m DOM.HTMLElement
174+emptyElWith' elementTag cfg = liftM fst $ buildElementNS (cfg ^. namespace) elementTag (cfg ^. attributes) $ return ()