OAuth2 Refresh token and Http Request

I think the short answer is that in case you want to persist new state like new token you need to do so via update function as there is no other way to update the model in tea.

The second question is how would you go about it. And answer to that is that there are different ways with different tradeoffs. I would personally suggest use something you’re familiar with. It can be anything on a scale from the most simple function String -> Model -> Model to state monad. Passing functions in Msgs or avoiding that.