on develop help sign in
Add optimized version of mainWidget
c9328bfDoug Beardsley
src/Reflex/Dom/Internal.hs+8
@@ -50,6 +50,14 @@ mainWidget w = runWebGUI $ \webView -> withWebViewSingleton webView $ \webViewSi
50 Just body <- getBody doc
50 Just body <- getBody doc
51 attachWidget body webViewSing w
51 attachWidget body webViewSing w
52
52
53+{-# INLINABLE mainWidget' #-}
54+-- | Warning: `mainWidget'` is provided only as performance tweak. It is expected to disappear in future releases.
55+mainWidget' :: Widget () () -> IO ()
56+mainWidget' w = runWebGUI $ \webView -> withWebViewSingletonMono webView $ \webViewSing -> do
57+ Just doc <- fmap DOM.castToHTMLDocument <$> webViewGetDomDocument webView
58+ Just body <- getBody doc
59+ attachWidget body webViewSing w
60+
53--TODO: The x's should be unified here
61--TODO: The x's should be unified here
54{-# INLINABLE mainWidgetWithHead #-}
62{-# INLINABLE mainWidgetWithHead #-}
55mainWidgetWithHead :: (forall x. Widget x ()) -> (forall x. Widget x ()) -> IO ()
63mainWidgetWithHead :: (forall x. Widget x ()) -> (forall x. Widget x ()) -> IO ()