I know I can use Flow but this is a small side pro...
# multiplatform
s
I know I can use Flow but this is a small side project and I'm trying to limit myself to familiar APIs.
l
Flow
official doc fits in one page, and it's basically built upon 3 base functions:
flow { ... }
(creates a cold
Flow
, lambda executed on each flow activation),
emit(element)
available from the
flow
lambda, emits an element, and `collect { e -> ... }`: collects all elements, unless the coroutine is cancelled (either from inside or outside). All other operators are build on that, and are pretty straightforward, and accompanied with doc.