Skip to content

Commit

Permalink
It's doing something!
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Bärenz authored and turion committed Nov 16, 2024
1 parent 86fab85 commit c7d45ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rhine-tree/src/FRP/Rhine/Tree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import Language.Javascript.JSaddle (MonadJSM (..), fun, js, js1, jsg, jss, syncP
import Language.Javascript.JSaddle.Types (JSM)
import Prelude hiding (unzip)
import Data.Automaton.Trans.State (runStateS)
import qualified FRP.Rhine.ClSF.State as ClSF

default (Text)

Expand Down Expand Up @@ -224,8 +225,13 @@ runStateTDOM action = do

runStateTDOMS :: JSMSF DOM a b -> ClSF JSM JSMClock a b
runStateTDOMS sf = feedback mempty $ proc (a, dom_) -> do
ClSF.runStateS sf -< _
_ -< _
constMCl $ logJS "starting runStateTDOM" -< ()
(dom', b) <- ClSF.runStateS sf -< (dom_, a)
constMCl $ logJS "Calculated:" -< ()
arrMCl logJS -< render dom'
doc <- constMCl $ jsg ("document" :: Text) -< ()
arrMCl (\(t, doc) -> doc ^. js ("body" :: Text) ^. jss ("innerHTML" :: Text) t) -< (render dom_, doc)
returnA -< (b, dom')

-- FIXME generalise
type JSMSF node a b = ClSF (StateT node JSM) JSMClock a b
Expand Down

0 comments on commit c7d45ae

Please sign in to comment.