Skip to content

Instantly share code, notes, and snippets.

@cbpudding
Last active December 20, 2024 22:25
Show Gist options
  • Save cbpudding/1ac2ced38bc26cea303faf02fb5e647e to your computer and use it in GitHub Desktop.
Save cbpudding/1ac2ced38bc26cea303faf02fb5e647e to your computer and use it in GitHub Desktop.
The code I rewrite all the time to make a single page web application in Elm
module Main exposing (..)
import Browser exposing (Document, UrlRequest)
import Browser.Navigation exposing (Key)
import Url exposing (Url)
type alias Flags = ()
type alias Model = ()
type alias Msg = ()
main : Program Flags Model Msg
main =
Browser.application
{ init = init
, onUrlChange = onUrlChange
, onUrlRequest = onUrlRequest
, subscriptions = subscriptions
, update = update
, view = view
}
init : Flags -> Url -> Key -> (Model, Cmd Msg)
init _ _ _ =
((), Cmd.none)
onUrlChange : Url -> Msg
onUrlChange _ =
()
onUrlRequest : UrlRequest -> Msg
onUrlRequest _ =
()
subscriptions : Model -> Sub Msg
subscriptions _ =
Sub.none
update : Msg -> Model -> (Model, Cmd Msg)
update _ model =
(model, Cmd.none)
view : Model -> Document Msg
view _ =
{ title = ""
, body = []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment