arowM / tepa / Tepa.Navigation

This module helps you manage the browser's URL yourself.

You should not use the Browser.Navigation module with TEPA because the page transitions caused by the module are not recognized by the TEPA Scenario test.

Refer to the Browser.Navigation documentation for more detailed notes.

Navigate within Page

pushPath : Tepa.NavKey -> AppUrl -> Tepa.Promise m ()

Change the URL path, but do not trigger a page load. You can construct the URL path using lydell/elm-app-url.

This will add a new entry to the browser history.

Refer to the Browser.Navigation.pushUrl documentation for more detailed notes.

This is the TEPA version of pushUrl.

replacePath : Tepa.NavKey -> AppUrl -> Tepa.Promise m ()

Change the URL path, but do not trigger a page load. You can construct the URL path using lydell/elm-app-url.

This will not add a new entry to the browser history.

Refer to the Browser.Navigation.replaceUrl documentation for more detailed notes.

This is the TEPA version of replaceUrl.

back : Tepa.NavKey -> Basics.Int -> Tepa.Promise m ()

Go back some number of pages. So back 1 goes back one page, and back 2 goes back two pages.

Refer to the Browser.Navigation.back documentation for more detailed notes.

This is the TEPA version of back.

forward : Tepa.NavKey -> Basics.Int -> Tepa.Promise m ()

Go forward some number of pages. So forward 1 goes forward one page, and forward 2 goes forward two pages. If there are no more pages in the future, this will do nothing.

Refer to the Browser.Navigation.back documentation for more detailed notes.

This is the TEPA version of forward.

Navigate to other Pages

load : String -> Tepa.Promise m ()

Leave the current page and load the given URL. This always results in a page load, even if the provided URL is the same as the current one.

gotoElmWebsite : Promise m ()
gotoElmWebsite =
    load "https://elm-lang.org"

Check out the lydell/elm-app-url package for help building URLs.

This is the TEPA version of load.

reload : Tepa.Promise m ()

Reload the current page. This always results in a page load! This may grab resources from the browser cache, so use reloadAndSkipCache if you want to be sure that you are not loading any cached resources.

This is the TEPA version of reload.

reloadAndSkipCache : Tepa.Promise m ()

Reload the current page without using the browser cache. This always results in a page load! It is more common to want reload.

This is the TEPA version of reloadAndSkipCache.