flow() creates a cold Flow. Nothing happens until something starts collecting the output of the Flow — in this case, the collect() call in main(). The events only exist if something is collecting them.
b4777467766fez uma citaçãohá 2 anos
each Flow created by flow() can only be collected once — we cannot have multiple collectors.
These are fairly severe limitations.
b4777467766fez uma citaçãohá 2 anos
SharedFlow is a hot flow that can have multiple consumers, with each consumer seeing the same sequence of emitted events as any other active consumer at the time.
fb2epub
Arraste e solte seus arquivos
(não mais do que 5 por vez)