mirror of
https://github.com/ryannhg/elm-spa.git
synced 2024-11-22 09:44:55 +03:00
arrow bois
This commit is contained in:
parent
fe048e5d83
commit
6dae16d7eb
@ -98,17 +98,12 @@ init :
|
||||
-> Nav.Key
|
||||
-> ( Model flags model, Cmd (Msg msg) )
|
||||
init config flags url key =
|
||||
let
|
||||
( page, cmd ) =
|
||||
url |> config.fromUrl |> config.init
|
||||
in
|
||||
( { flags = flags
|
||||
, url = url
|
||||
, key = key
|
||||
, page = page
|
||||
}
|
||||
, Cmd.map Page cmd
|
||||
)
|
||||
url
|
||||
|> config.fromUrl
|
||||
|> config.init
|
||||
|> Tuple.mapBoth
|
||||
(\page -> { flags = flags, url = url, key = key, page = page })
|
||||
(Cmd.map Page)
|
||||
|
||||
|
||||
|
||||
@ -132,16 +127,12 @@ update :
|
||||
update config msg model =
|
||||
case msg of
|
||||
Url url ->
|
||||
let
|
||||
( page, cmd ) =
|
||||
url |> config.fromUrl |> config.init
|
||||
in
|
||||
( { model
|
||||
| url = url
|
||||
, page = page
|
||||
}
|
||||
, Cmd.map Page cmd
|
||||
)
|
||||
url
|
||||
|> config.fromUrl
|
||||
|> config.init
|
||||
|> Tuple.mapBoth
|
||||
(\page -> { model | url = url, page = page })
|
||||
(Cmd.map Page)
|
||||
|
||||
Link (Browser.Internal url) ->
|
||||
( model
|
||||
|
Loading…
Reference in New Issue
Block a user