I recently came across a simplified version of Net...
# android
z
I recently came across a simplified version of NetworkBoundResource. I was wondering how I could trigger a refresh (through user interaction, when pressing a button) if the flow fails and emits an error. Or is this inline function not the right approach?
g
You can add "refresh" lambda to Resource.Error, so client will be able to refresh it, but then you have to decide how it will work, or this refresh returns new Flow<Resource>, it's easy to do, but not very easy to use, or you modify flow, to always be active (so do not complete after error/success) and emit Loading/Success after refresh