I'm working with an API that returns several items...
# ktor
z
I'm working with an API that returns several items per page and to get more you have to do another request with the next page number. Is there a way I could simplify this so it just provides a flow that automatically makes the requests until it runs out of items?
s
Yes! Perfect use case for flows. Just use a normal
flow { ... }
builder and write the body as a loop where you emit the result of each successive call.