OK, I just don’t quite understand, even while I have working code!
I have an app where, as the model changes (in particular the value
representing the ‘page’ of my single page app), the Url is updated with
this task
Navigation.newUrl (toUrl model)
But as the Url changes, I get a new message from Navigation because of:
main =
Navigation.programWithFlags
(Routing.urlParser RouteTo)
{ init = initWithFlags
, update = Routing.update
, view = view
, subscriptions = subscriptions
}
When first loading the app, this message is useful and I can use it to
direct to the appropriate opening page. But thereafter this message is
redundant - I already made all the model changes I wanted before and that
caused the Url update. Without some care I even get a loop of each Routing
message causing the
*I suspect I am missing something rather important, but am not sure what?*
One option would be to use anchor tags to cause the switch pages, and only
do model changes when I get a RouteTo message, but even then I have some
url changes resulting from the clicking on an element within a page, and I
don’t think that is a place for anchors. (As I use html urls, rather than #
ones I also have to be careful not to let the page get reloaded)
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.