Created
January 12, 2021 22:10
-
-
Save lleveque/63792329222dca8cbed59fcf9c151f1e to your computer and use it in GitHub Desktop.
Elm boilerplate for Browser.element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Browser | |
import Html exposing (Html, text) | |
main = Browser.element | |
{ init = init | |
, update = update | |
, subscriptions = subscriptions | |
, view = view | |
} | |
type alias State = String | |
type Message = NOOP | |
-- The `init` signature defines which types your element will use to hold state and pass messages | |
init : () -> (State, Cmd Message) | |
init _ = ("This is the initial state", Cmd.none) | |
update : Message -> State -> (State, Cmd Message) | |
update message state = (state, Cmd.none) | |
subscriptions : State -> Sub Message | |
subscriptions state = Sub.none | |
view : State -> Html Message | |
view state = text state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment