Multiple components: still WIP but compiling.

master
Philippe Pittoli 2023-05-22 16:23:21 +02:00
parent 778a51604b
commit 48006c37e8
2 changed files with 10 additions and 8 deletions

View File

@ -125,7 +125,7 @@ main = do
HA.runHalogenAff do HA.runHalogenAff do
body <- HA.awaitBody body <- HA.awaitBody
let url = "ws://localhost:8080" let url = "ws://localhost:8080"
runUI rootComponent url body runUI component url body
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- WebSocket message type -- WebSocket message type
@ -137,6 +137,8 @@ type WebSocketMessageType = ArrayBuffer
-- Root component module -- Root component module
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
type Slot = H.Slot Query Void
type Query :: forall k. k -> Type type Query :: forall k. k -> Type
type Query = Const Void type Query = Const Void
type Input = String type Input = String
@ -161,8 +163,8 @@ type State =
, canReconnect :: Boolean , canReconnect :: Boolean
} }
rootComponent :: forall m. MonadAff m => H.Component Query Input Output m component :: forall m. MonadAff m => H.Component Query Input Output m
rootComponent = component =
H.mkComponent H.mkComponent
{ initialState { initialState
, render , render

View File

@ -121,11 +121,11 @@ renderError = case _ of
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
main :: Effect Unit main :: Effect Unit
main = do main = HA.runHalogenAff do
HA.runHalogenAff do body <- HA.awaitBody
body <- HA.awaitBody let url = "ws://localhost:8080"
let url = "ws://localhost:8080" runUI rootComponent url body
runUI rootComponent url body -- runUI Container.component unit body
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- WebSocket message type -- WebSocket message type