Skip to content

Instantly share code, notes, and snippets.

@mwunsch
Last active Mar 22, 2017
Embed
What would you like to do?
Elm Boilerplate
module Main exposing (..)
-- Stick this Elm file in a directory. Run `elm make` in the
-- directory. Run `elm reactor`. Now you have an Elm program.
import Html exposing (..)
main : Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
}
-- MODEL
type alias Model =
{}
init : ( Model, Cmd Msg )
init =
( {}, Cmd.none )
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
-- VIEW
view : Model -> Html Msg
view model =
Html.text "Hello, world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment