on develop help sign in
Add optimized version of mainWidget
commitc9328bff8f2a1e5f1c211f9b305d562653ba40c0 authorDoug Beardsley <mightybyte@gmail.com> dateTue 18 Apr 2017, 17:39 (10 years ago) parent8c30dd6
1 file changed+8
src/Reflex/Dom/Internal.hs+8
src/Reflex/Dom/Internal.hs+8
@@ -50,6 +50,14 @@ mainWidget w = runWebGUI $ \webView -> withWebViewSingleton webView $ \webViewSi
5050 Just body <- getBody doc
5151 attachWidget body webViewSing w
5252
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+
5361--TODO: The x's should be unified here
5462{-# INLINABLE mainWidgetWithHead #-}
5563mainWidgetWithHead :: (forall x. Widget x ()) -> (forall x. Widget x ()) -> IO ()