Elm: How to fetch data on page load with Navigation.newUrl? -


i have elm application multiple pages/routes. have "/dashboard" route needs data on page load.

i had modify init function when user hard browser reload, , had modify update function's onlocationchange clause when navigation.newurl called.

my question is: right way this? hate having modify 2 functions when feels there should 1 place handles this.

i think let update function handle cmd creation.

init : navigation.location -> ( model, cmd msg ) init location =     update         (locationchange location)         initialmodel 

Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -