Mikolaj Leszczynski
08/05/2021, 7:12 AMEric Ampire [MOD]
08/05/2021, 10:21 AM> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.orbit-mvi:orbit-core:4.2.0.
Searched in the following locations:
<https://dl.google.com/dl/android/maven2/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
<https://repo.maven.apache.org/maven2/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
<https://jcenter.bintray.com/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
Eric Ampire [MOD]
08/05/2021, 3:19 PMOleksii Malovanyi
08/09/2021, 3:31 PM2.4.0
release uses alpha version of androidx.lifecycle library. I have a wish and a request to write about things like this (alpha/beta versions of 3rd party dependencies) in release notes, maybe even with extra exclamation marks ⚠️ E.g. for us it’s a blocker to update orbit to 2.4.0
as we don’t have much faith in google’s alpha-beta quality…Guilherme Delgado
08/11/2021, 9:27 PMGuilherme Delgado
08/12/2021, 8:42 AMintent
, I’ll add details in thread:Stephan Schuster
08/23/2021, 8:53 AMSimon
09/01/2021, 3:00 PMEric Ampire [MOD]
09/04/2021, 8:54 PMprivate fun Flow<Result<List<Lottiefile>>>.fetchData() = intent(registerIdling = false) {
collect { result ->
when(result) {
is Result.Error -> {
Timber.e(result.toString())
val errorMessage = result.exception.localizedMessage ?: "Unknown Error"
reduce { state.copy(isLoading = false) }
postSideEffect(ExploreEffect.ShowErrorMessage(errorMessage))
}
Result.Loading -> {
Timber.e(result.toString())
reduce { state.copy(isLoading = true) }
}
is Result.Success -> {
Timber.e(result.toString())
reduce { state.copy(files = result.data, isLoading = false) }
}
}
}
}
The state is collected like that
val state by viewModel.container.stateFlow.collectAsState()
Guilherme Delgado
09/16/2021, 1:56 PMOleksii Malovanyi
09/17/2021, 2:29 PMrunOnCreate
function so one could subscribe to container from it -> currently it’s impossible due to compilation restrictions, so in case of ViewModel we have to subscribe from the `init{}`which then could affect tests which don’t wanna run runOnCreate
on TestContainerGuilherme Delgado
09/27/2021, 12:04 PM@IgnoredOnParcel
?
Thanks!Stephan Schuster
10/12/2021, 9:37 AMStephan Schuster
10/12/2021, 9:48 AMkenkyee
10/13/2021, 7:13 PMkenkyee
10/13/2021, 7:30 PMGuilherme Delgado
10/15/2021, 8:33 AMkenkyee
10/15/2021, 11:00 AMkenkyee
10/15/2021, 12:24 PMkenkyee
10/15/2021, 12:26 PMBenoît
10/22/2021, 2:38 PMBenoît
10/25/2021, 9:10 PMfold()
and dispatch and effect on the left case (error), and a new state on the right case (success), within the same fold()
Using Orbit-MVI I either have to fold the apiResponse
twice in the reduce block and the suspend block from the intent
(option1), or do the fold()
outside the reduce block but then the fold is happening in the impure world which isn't good practice in my opinion.
Which option do you think is best, and is there any alternative to achieve this?Oleksii Malovanyi
10/28/2021, 7:59 AMkenkyee
11/01/2021, 2:50 PMprivate suspend fun SimpleSyntax<TaskScreenState, TaskScreenSideEffect>.addTaskReducer(
onComplete: () -> Unit
) {
hmm....technically, that's not a reducer though... 🤔
but SimpleSyntax is an odd name for this too.kenkyee
11/01/2021, 6:22 PMGuilherme Delgado
11/04/2021, 1:46 PMkenkyee
11/04/2021, 4:20 PMGuilherme Delgado
11/08/2021, 11:30 AMkenkyee
11/12/2021, 12:37 PMMikolaj Leszczynski
11/15/2021, 7:48 AMandroidx.lifecycle
to 2.4.0
🎉
Enjoy!