https://kotlinlang.org logo
#android
Title
# android
a

althaf

08/22/2022, 11:16 AM
Is there is short form to let flow know that we want to take same action even if it is a failure or success
Copy code
authRepository.logout().catch {
    fc.emit(Result.failure(LoginSessionExpiredException()))
}.collect {
    fc.emit(Result.failure(LoginSessionExpiredException()))
}
e

ephemient

08/22/2022, 11:21 AM
Copy code
.catch { /* ignore */ }.onCompletion {
    fc.emit(Result.failure(LoginSessionExpiredException()))
}
1
7 Views