mirror of
https://github.com/ryannhg/elm-spa.git
synced 2024-11-22 09:44:55 +03:00
single page apps made easy
example | ||
src | ||
.gitignore | ||
elm-analyse.json | ||
elm.json | ||
netlify.toml | ||
package-lock.json | ||
package.json | ||
README.md |
ryannhg/elm-app
an experiment for creating single page apps with Elm!
try it out
-
npm install
-
npm run dev
overview
module Main exposing (main)
import Application exposing (Application)
import Generated.Pages as Pages
import Generated.Route as Route
import Layout as Layout
main : Application () Pages.Model Pages.Msg
main =
Application.create
{ routing =
{ fromUrl = Route.fromUrl
, toPath = Route.toPath
}
, layout =
{ view = Layout.view
}
, pages =
{ init = Pages.init
, update = Pages.update
, bundle = Pages.bundle
}
}
supporting code
-
Pages.Homepage
(a static page) -
Pages.Counter
(a sandbox page) -
Pages.Random
(a static page)