Don't use a halogen component if the html element is missing
I am completely new to purescript and halogen. I am trying to display a halogen component (myButton) when an html element exists and do nothing.
displayButton :: Eff (HA.HalogenEffects ()) Unit
displayButton = HA.runHalogenAff do
containerElement <- HA.selectElement (QuerySelector "#halogen-button")
case containerElement of
Nothing -> ???
Just element -> runUI myButton unit element
I don't know what code to put in the Nothing clause so that my code type checks and does nothing in this case.
+3
source to share