Skip to content

Instantly share code, notes, and snippets.

@sethlivingston
Last active March 29, 2020 17:07
Show Gist options
  • Save sethlivingston/d49423598d45dcd1813573a29f59d8cf to your computer and use it in GitHub Desktop.
Save sethlivingston/d49423598d45dcd1813573a29f59d8cf to your computer and use it in GitHub Desktop.
Elm template for a Browser.element app
module TemplateModule exposing (main)
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
-- MODEL
type alias Model =
{}
type alias Flags =
{}
initialModel : Flags -> Model
initialModel flags =
{}
init : Flags -> ( Model, Cmd Msg )
init flags =
( initialModel flags, Cmd.none )
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
-- VIEW
view : Model -> Html Msg
view model =
div [] []
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions _ =
Sub.none
-- MAIN
main : Program Flags Model Msg
main =
Browser.element
{ init = init
, update = update
, view = view
, subscriptions = subscriptions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment