Formerly ryannhg/elm-spa. Search finds this package by either name.
Every page gets access to a request, which has information about the current URL, route parameters, query parameters etc.
page : Shared.Model -> Request Params -> Page Model Msg
page _ request =
Page.element
{ init = init
, update = update
, view = view request
}You can choose to pass this request into init,update, or any other function
that might need access to URL-related information.
A convenience function for creating requests, used by elm-spa internally.
request : Request Route { name : String }
request =
Request.create (Route.fromUrl url)
{ name = "ryan" }
url
key
Here is an example request for the route
/people/:nameAnd another example with a some query parameters: