Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.