Integrate Combine Into an App, Episode 4: Use Publishers in the ViewModel | Kodeco, the new raywenderlich.com

Publishers are only part of the Combine pipeline; they have to be subscribed to in order to start the data flowing. In this episode, learn how the Publishers you’ve made can be used in the ViewModel that will drive the user interface.


This is a companion discussion topic for the original entry at https://www.kodeco.com/22070915-integrate-combine-into-an-app/lessons/4

I know it’s probably more of an opinion based question, but I’m curious about the decision for placing the decoding, retrying and replace error logic inside of the view model instead of the service. As it is, the JokesService feels very light and the view model is rather heavy. Could you explain your thinking process behind placing this logic inside of the “ViewModel”?