Skip to content

Instantly share code, notes, and snippets.

@gaaamii
Created November 28, 2019 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaaamii/1965aeaca99b07546afc0580fb99c9b7 to your computer and use it in GitHub Desktop.
Save gaaamii/1965aeaca99b07546afc0580fb99c9b7 to your computer and use it in GitHub Desktop.
-- Main.elm
type Msg
= Hoge
| OnClickButtonInModal
view model =
div [] [
...
, Modal.view { visible = model.isModalVisible } OnClickButtonInModal
]
-- Modal.elm
type alias Props =
{ visible : Bool
}
view : Props -> msg -> Html msg
view props msg =
button [ onClick msg ] []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment