mng
11/25/2020, 6:44 PMsuspend functions
vs Flows
. Assuming I follow a Clean architecture approach for my application, when should i be using suspend functions
and when should I use Flows
?
Assuming I am only ever handling cold streams of data, when should I use one over the other?
Should the presentation layer only be exposed to Flows
and suspend functions
be used by data and domain layers? Should the suspend functions
just be used for “one-off” type functions that need to be done on a separate thread?Marko Novakovic
11/25/2020, 8:01 PMsuspend fun
or flow
. use what you need. if you need stream of data and need to transform that data use flow
if not use suspend fun
Marko Novakovic
11/25/2020, 8:02 PMflow
to complicate code when suspend fun
will do