Skip to content

Instantly share code, notes, and snippets.

@sarasfox
Created September 30, 2018 17:32
Show Gist options
  • Save sarasfox/38ce1b98a0340b7e336cf5e18594785d to your computer and use it in GitHub Desktop.
Save sarasfox/38ce1b98a0340b7e336cf5e18594785d to your computer and use it in GitHub Desktop.
module ArchitechedHello exposing (..)
import Browser exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
main =
Browser.sandbox { model = model, view = view, update = update}
type alias Model =
{text: String}
model : Model
model =
{text = "Hello world"}
type Msg
= Text String
update : Msg -> Model -> Model
update msg model =
case msg of
Text txt ->
{model | text = model.text ++ "!"}
view : Model -> Html Msg
view model =
div []
[ div [] [text model.text]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment