From ae5625eb8af5eaf706b6d792e2ce6b62667f98f0 Mon Sep 17 00:00:00 2001 From: ZeeQyu <-> Date: Fri, 10 Dec 2021 23:16:17 +0100 Subject: [PATCH] Fix incomplete example on Navigation --- book/webapps/navigation.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/book/webapps/navigation.md b/book/webapps/navigation.md index f2e082c8..80834efb 100644 --- a/book/webapps/navigation.md +++ b/book/webapps/navigation.md @@ -153,6 +153,16 @@ view model = viewLink : String -> Html msg viewLink path = li [] [ a [ href path ] [ text path ] ] + + +onUrlChange : Url.Url -> Msg +onUrlChange url = + UrlChanged url + + +onUrlRequest : Browser.UrlRequest -> Msg +onUrlRequest urlRequest = + LinkClicked urlRequest ``` The `update` function can handle either `LinkClicked` or `UrlChanged` messages. There is a lot of new stuff in the `LinkClicked` branch, so we will focus on that first!