The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Elm in 7 minutes

Elm in 7 minutes

6:54
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.
Watch this lesson now
Avatar
egghead.io

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.

Avatar
greg
Html exposing (div, text, button)
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
Avatar
Bruce

Any plans for a full Elm course? Thanks

In reply to egghead.io
Avatar
Song Yangyu

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

Avatar
hipertracker

+1 Elm is the most interesting solution for JavaScript fatigue.

In reply to Bruce
Avatar
Nicolas del Valle

A full course on Elm would be great :D

Avatar
Deoward

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

Avatar
aleksandre

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

Avatar
Thomas

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

Avatar
Zhentian

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

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?