File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
data/src/main/java/com/hoc/flowmvi/data Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ object deps {
7070
7171 const val coil = " io.coil-kt:coil:2.6.0"
7272 const val viewBindingDelegate = " com.github.hoc081098:ViewBindingDelegate:1.4.0"
73- const val flowExt = " io.github.hoc081098:FlowExt:0.8.0 "
73+ const val flowExt = " io.github.hoc081098:FlowExt:0.8.1-Beta "
7474 const val timber = " com.jakewharton.timber:timber:5.0.1"
7575
7676 object arrow {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import com.hoc.flowmvi.domain.model.User
1616import com.hoc.flowmvi.domain.model.UserError
1717import com.hoc.flowmvi.domain.model.UserValidationError
1818import com.hoc.flowmvi.domain.repository.UserRepository
19+ import com.hoc081098.flowext.catchAndReturn
1920import com.hoc081098.flowext.flowFromSuspend
2021import com.hoc081098.flowext.retryWithExponentialBackoff
2122import com.hoc081098.flowext.scanWith
@@ -25,7 +26,6 @@ import kotlin.time.ExperimentalTime
2526import kotlinx.coroutines.ExperimentalCoroutinesApi
2627import kotlinx.coroutines.FlowPreview
2728import kotlinx.coroutines.flow.MutableSharedFlow
28- import kotlinx.coroutines.flow.catch
2929import kotlinx.coroutines.flow.first
3030import kotlinx.coroutines.flow.map
3131import kotlinx.coroutines.flow.onEach
@@ -90,9 +90,9 @@ internal class UserRepositoryImpl(
9090 }
9191 }.onEach { Timber .d(" [USER_REPO] Emit users.size=${it.size} " ) }
9292 .map { it.right().leftWiden<UserError , _ , _ >() }
93- .catch {
93+ .catchAndReturn {
9494 logError(it, " getUsers" )
95- emit( errorMapper(it).left() )
95+ errorMapper(it).left()
9696 }
9797
9898 override suspend fun refresh () =
You can’t perform that action at this time.
0 commit comments