I have a strange (for me) behaviour in my flow. I have a backend call
in which some entity will be saved. I have a page redirect logic e.g.:
type alias Model
{ page : Int
}
view model =
case model.page of
0 -> viewA
1 -> viewB
...
In my 'update' function I will set this pages:
update action model =
case action of
ActionA -> { model | page = 0 } ! [ saveEntity ]
SaveE (Err _) -> model ! []
SaveE (Ok _) -> { model | page = 1 } ! []
I have a button which triggers ActionA and this shows the viewB. So
sometimes it works as expected and sometimes the whole page will be
reloaded and the init function will be called and my model is
initialized with the starting values.
The backend gets some values and saves the entity in the db. This
works fine with a curl-call.
So my question is, is there a trigger which reloads the page and calls
the init function?
My problem is it seems that this happens randomly and I have currently
no idea where the problem comes from.
thx
\= odi
--
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.