I am using `Flow` with `suspend functions` to read...
# coroutines
s
I am using
Flow
with
suspend functions
to read a stream of data from my API. To get all the registered users,
flow
seems like a cool option. But while creating a user which is a one-shot function, would flow really come in handy? I really like the idea of emitting streams by passing a Result wrapper around the data and this gives me more clarity and readability in code. Just want to know if it is considered as best practice to use Flow for one shot functions like creating a user or does it become unnecessary?
l
A simple suspending function makes more sense where it's possible. Otherwise, it's pretty easy to make a flow out of suspending functions.
☝️ 1
😯 1
s
Thank you @louiscad