Elm in 7 minutes

Ronn Ross
InstructorRonn Ross

Share this video with your friends

Send Tweet

We are going to take a high-level look at what an Elm application looks like? We show how to structure apps, as well as, Elm’s elegant syntax by building a small app.

greg b
greg b
~ 5 years ago
import StartApp.Simple as StartApp
import Html.Events exposing (onClick)

main =
    StartApp.start
        {
            model = initialModel,
            view = view,
            update = update
        }

initialModel = 0

type Action
    = Increment
    | Decrement

update action model =
    case action of
        Increment ->
            model + 1
        Decrement ->
            model - 1

view address model =
    div []
        [
            button [onClick address Increment] [text "+"],
            div [] [text (toString model)],
            button [onClick address Decrement] [text "-"]
        ]
$ elm-package install evancz/elm-html
$ elm-package install evancz/start-app
$ elm make Main.elm --output=index.html
Song Yangyu
Song Yangyu
~ 5 years ago

Thinking would be helpful if a how to setup elm is provided

Nicolas del Valle
Nicolas del Valle
~ 5 years ago

A full course on Elm would be great :D

Deoward
Deoward
~ 5 years ago

I agree that an in depth course on Elm would be awesome...

aleksandre adamia
aleksandre adamia
~ 5 years ago

Looking forward for more videos, thank you for advocating for such an awesome approach in JS.

Thomas
Thomas
~ 5 years ago

+1 it would be interesting to have a full course on Elm, and on ClojureScript!

Zhentian Wan
Zhentian Wan
~ 5 years ago

It would be great can explain why use Elm at the first place? That would be great...