Is there a naming convention for functions returni...
# coroutines
d
Is there a naming convention for functions returning a
Flow
? (like Async suffix for the ones returning a
Deferred
)
o
for me the answer is no, because it is similar to a Stream-returning function, which I don't name differently from other functions. Typically they are named to indicate a collection/iterable, such as
listItems()
1
e
Deferred
is error-prone (it’s hot and you must not forget to await!) hence the naming convention to warn the user. There are no such problems with flow, hence no need for a special naming.
d
Okay, thank you! :)
e
You will lose exception if the method returning deferred failed, unless it was using structured concurrency.
l
Somtimes, I suffix the property or function with
Flow
, like
locationUpdatesFlow
.
d
That's what I was doing, but it's ugly!
I'm considering -Flower
🙂