Tash
06/04/2020, 11:01 PMFlow<T>
For example:
// For Flow<List<*>>
fun postsFlow(): Flow<List<Post>>
// OR
fun postLists(): Flow<List<Post>>
// For Flow<*>
fun eventFlow(): Flow<Event>
// OR
fun events(): Flow<Event>
Would be interesting to know if there are other preferred styles.Ray Ryan
06/04/2020, 11:05 PMpostList()
for the first one, if it’s a property that changes on occasion.henrikhorbovyi
06/04/2020, 11:51 PMOrhan Tozan
06/08/2020, 8:21 AMelizarov
06/08/2020, 8:50 AMevents()
. Those ()
do not signify anything. Just writing events
should do just as well.Tash
06/08/2020, 8:04 PMOrhan Tozan
06/09/2020, 8:32 PMTash
06/09/2020, 8:38 PMfun events() = flow<Event> {
...
}
VS
val events = flow<Event> {
...
}
And not about the case where events()
causes side-effects etc.louiscad
06/09/2020, 9:01 PMflow { }
builder, there's not really any side effects, that's why it's perfectly safe to keep it in a property.