https://kotlinlang.org logo
#flow
Title
# flow
c

Canato

09/01/2020, 5:45 PM
Hey people, good day =D I’m having an issue of founding the best usage of Kotlin Flow in a normal API request. Basically I’m doing a small sample Android app with Flow usage for my team. I will retrieve the data from a API endpoint and want to show it in a List. I’m using MVP arch and no LiveData.
Does any one can guide me to an article or sample app where this works?
Not sure what is the best single responsibility for this case. • Do I retrieve all information from the Endpoint and emit after each map? • Can I use Flow for pagination ? • Maybe this is not a good case for Flow? Thanks ;)
r

rkeazor

09/03/2020, 7:20 AM
Flow is normally for a stream of data... If your just doing a one off Api call, than you can use a normal suspend function
2 Views