Do not run an halogen component when an html element is not present

Viewed 175

I'm absolutely new to purescript and halogen. I'm trying to display an halogen component (myButton) when an html element exists, and do nothing otherwise.

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 do nothing in that case.

1 Answers
Related