Last active
March 22, 2017 01:12
-
-
Save mwunsch/99e70f774a9f065bac778aed505d4f9b to your computer and use it in GitHub Desktop.
Elm Boilerplate
This file contains 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
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