Removing LoginScreen to the navigation graph
This commit is contained in:
@@ -5,7 +5,6 @@ import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
|
||||
/**
|
||||
* Executes business logic in its execute method and keep posting updates to the result as
|
||||
@@ -14,7 +13,6 @@ import kotlinx.coroutines.flow.onStart
|
||||
*/
|
||||
abstract class FlowUseCase<in P, R>(private val coroutineDispatcher: CoroutineDispatcher) {
|
||||
operator fun invoke(parameters: P): Flow<Result<R>> = execute(parameters)
|
||||
.onStart { emit(Result.Loading) }
|
||||
.catch { e -> emit(Result.Error(Exception(e))) }
|
||||
.flowOn(coroutineDispatcher)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user