on develop help sign in
Remove battery zapping syncPoints
4d34ef5Hamish Mackenzie
reflex-dom-core/src/Reflex/Dom/Main.hs+1−15
@@ -51,9 +51,6 @@ mainWidget w = withJSContextSingleton $ \jsSing -> do
51 doc <- currentDocumentUnchecked
51 doc <- currentDocumentUnchecked
52 body <- getBodyUnchecked doc
52 body <- getBodyUnchecked doc
53 attachWidget body jsSing w
53 attachWidget body jsSing w
54− forever $ do
55− liftIO $ threadDelay 100000
56− syncPoint
57
54
58--TODO: The x's should be unified here
55--TODO: The x's should be unified here
59{-# INLINABLE mainWidgetWithHead #-}
56{-# INLINABLE mainWidgetWithHead #-}
@@ -64,9 +61,6 @@ mainWidgetWithHead h b = withJSContextSingleton $ \jsSing -> do
64 attachWidget headElement jsSing h
61 attachWidget headElement jsSing h
65 body <- getBodyUnchecked doc
62 body <- getBodyUnchecked doc
66 attachWidget body jsSing b
63 attachWidget body jsSing b
67− forever $ do
68− liftIO $ threadDelay 100000
69− syncPoint
70
64
71{-# INLINABLE mainWidgetWithCss #-}
65{-# INLINABLE mainWidgetWithCss #-}
72mainWidgetWithCss :: ByteString -> (forall x. Widget x ()) -> JSM ()
66mainWidgetWithCss :: ByteString -> (forall x. Widget x ()) -> JSM ()
@@ -76,9 +70,6 @@ mainWidgetWithCss css w = withJSContextSingleton $ \jsSing -> do
76 setInnerHTML headElement . Just $ "<style>" <> T.unpack (decodeUtf8 css) <> "</style>" --TODO: Fix this
70 setInnerHTML headElement . Just $ "<style>" <> T.unpack (decodeUtf8 css) <> "</style>" --TODO: Fix this
77 body <- getBodyUnchecked doc
71 body <- getBodyUnchecked doc
78 attachWidget body jsSing w
72 attachWidget body jsSing w
79− forever $ do
80− liftIO $ threadDelay 100000
81− syncPoint
82
73
83type Widget x = PostBuildT Spider (ImmediateDomBuilderT Spider (WithJSContextSingleton x (PerformEventT Spider (SpiderHost Global)))) --TODO: Make this more abstract --TODO: Put the WithJSContext underneath PerformEventT - I think this would perform better
74type Widget x = PostBuildT Spider (ImmediateDomBuilderT Spider (WithJSContextSingleton x (PerformEventT Spider (SpiderHost Global)))) --TODO: Make this more abstract --TODO: Put the WithJSContext underneath PerformEventT - I think this would perform better
84
75
@@ -166,9 +157,6 @@ mainWidgetInElementById eid w = withJSContextSingleton $ \jsSing -> do
166 doc <- currentDocumentUnchecked
157 doc <- currentDocumentUnchecked
167 root <- getElementByIdUnchecked doc eid
158 root <- getElementByIdUnchecked doc eid
168 attachWidget root jsSing w
159 attachWidget root jsSing w
169− forever $ do
170− liftIO $ threadDelay 100000
171− syncPoint
172
160
173data AppInput t = AppInput
161data AppInput t = AppInput
174 { _appInput_window :: Window t
162 { _appInput_window :: Window t
@@ -188,6 +176,4 @@ runApp' app = withJSContextSingleton $ \jsSing -> do
188 app $ AppInput
176 app $ AppInput
189 { _appInput_window = w
177 { _appInput_window = w
190 }
178 }
191− forever $ do
179+ return ()
192− liftIO $ threadDelay 100000
193− syncPoint