Why? And what about failures?
LouisCAD opened this issue · comments
Since is a suspend function, inside Resource.success you are callind the API which is another suspend function, any exceptions thrown by that call in the Resource.Success will propagate the error to the catch block in the viewmodel
But why use callbackFlow, and why make it a Flow at all?
And why wrap into Resource.Success if you don't wrap it in unsuccessful cases?
The reason of using callbackFlow there is that in this repo
About the failure, is beign handled in the viewmodel when that success operation returns an exception, it will be propagated to the viewmodel catch block of the calling function
Any improvements in the code will be more than welcome @LouisCAD 💯