Lukas Lechner
09/22/2022, 1:01 PM.cancellable()
flow operator?Casey Brooks
09/22/2022, 2:28 PMcollect { }
doesn’t make any suspending function calls. This is probably a very rare situation, so isn’t something you’d really need to worry about if you’re just getting started with Flows.
Normally, everything in the core coroutines library checks for cancellation automatically, but if you are doing something that emits values and nowhere in the Flow’s chain do any methods from the core coroutines get called, this operator will step in an check for cancellation so you don’t have to manually.