File tree 2 files changed +4
-4
lines changed
data/src/main/java/com/hoc/flowmvi/data
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ object deps {
70
70
71
71
const val coil = " io.coil-kt:coil:2.6.0"
72
72
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 "
74
74
const val timber = " com.jakewharton.timber:timber:5.0.1"
75
75
76
76
object arrow {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import com.hoc.flowmvi.domain.model.User
16
16
import com.hoc.flowmvi.domain.model.UserError
17
17
import com.hoc.flowmvi.domain.model.UserValidationError
18
18
import com.hoc.flowmvi.domain.repository.UserRepository
19
+ import com.hoc081098.flowext.catchAndReturn
19
20
import com.hoc081098.flowext.flowFromSuspend
20
21
import com.hoc081098.flowext.retryWithExponentialBackoff
21
22
import com.hoc081098.flowext.scanWith
@@ -25,7 +26,6 @@ import kotlin.time.ExperimentalTime
25
26
import kotlinx.coroutines.ExperimentalCoroutinesApi
26
27
import kotlinx.coroutines.FlowPreview
27
28
import kotlinx.coroutines.flow.MutableSharedFlow
28
- import kotlinx.coroutines.flow.catch
29
29
import kotlinx.coroutines.flow.first
30
30
import kotlinx.coroutines.flow.map
31
31
import kotlinx.coroutines.flow.onEach
@@ -90,9 +90,9 @@ internal class UserRepositoryImpl(
90
90
}
91
91
}.onEach { Timber .d(" [USER_REPO] Emit users.size=${it.size} " ) }
92
92
.map { it.right().leftWiden<UserError , _ , _ >() }
93
- .catch {
93
+ .catchAndReturn {
94
94
logError(it, " getUsers" )
95
- emit( errorMapper(it).left() )
95
+ errorMapper(it).left()
96
96
}
97
97
98
98
override suspend fun refresh () =
You can’t perform that action at this time.
0 commit comments