Does it make sense to define operations like that ...
# coroutines
m
Does it make sense to define operations like that to make a
Flow
more readable? 🤔 Also, is there a shorter way to “initialize”
distinctUntilChanged
with a value that it doesn’t emit? (I use
.onStart().distinctUntilChanged().drop()
here.)
l
Well, if you find a clear enough function signature (which might get some help from named parameter), it's quite easy to write your own doing these, using these operators, or even an optimized, custom implementation with local variables.
đź‘Ť 1
a
if the question is: “does it make sense to write your own extensions to Flow<T> to operate on them” then imho the answer is a resounding “yes”
đź‘Ť 1
t
I find such declarative code particularly elegant to be honest.
a
It clearly expresses your intent, reducing the temptation of comments to zero, so YES!!