The relevant point is that shown
doesn’t change based on any ControlBar
state—it’s something strictly controlled by the caller. The typical Elm API for hiding something is to decline to render it. There’s no Html.Button.hide
, for example—if you don’t want a button there, don’t call Html.button
!
I changed the API to be like button
: if the caller wants a ControlBar
, they call ControlBar.view
; otherwise, they don’t.