trathschlag
05/18/2020, 11:29 AMfun scroll() = flow {
try {
// do stuff
} finally {
withContext(NonCancellable) { suspendingCleanUpFunction() }
}
}
This does obviously not work. What would be the correct pattern here?marstran
05/18/2020, 11:46 AMtrathschlag
05/19/2020, 6:13 AMemit()
in some other place inside a withContext(NonCancellable)
So is the above considered ok?elizarov
05/19/2020, 7:04 AMfun scroll = flow { /* doStuff */ }
.onCompletion { /* do finally */ }