steelahhh
10/04/2020, 3:49 PMBootstrapper
, but SimpleBootstrapper
After configuration change this exception occurs on application launch:
java.lang.IllegalStateException: Value is already initialized: Function1<Action, kotlin.Unit>
at com.arkivanov.mvikotlin.utils.internal.AtomicExtKt.initialize(AtomicExt.kt:7)
at com.arkivanov.mvikotlin.extensions.coroutines.SuspendBootstrapper.init(SuspendBootstrapper.kt:26)
at com.arkivanov.mvikotlin.main.store.DefaultStore.<init>(DefaultStore.kt:58)
at com.arkivanov.mvikotlin.main.store.DefaultStoreFactory.create(DefaultStoreFactory.kt:21)
Although this is easily avoided by using SimpleBootstrapper
, I’m wondering is this behaviour intended or is there something that we have to do to prevent the exception from happening?
The issue can be reproduced in decompose or mvikotlin sample app by replacing the SimpleBootstrapper
by Suspend/ReaktiveBootstrapper
Arkadii Ivanov
10/04/2020, 3:56 PMsteelahhh
10/04/2020, 4:01 PMprivate object BootstrapperImpl: SuspendBootstrapper<Unit>() {
override suspend fun bootstrap() {
dispatch(Unit)
}
}
or whatever is the alternative with reaktive
Arkadii Ivanov
10/04/2020, 4:04 PMobject
. We should mention this in the docs. Contribution is welcome 😀Arkadii Ivanov
10/04/2020, 4:10 PMsteelahhh
10/04/2020, 4:17 PMincludeBuild
for now, since I was tweaking some of the internalssteelahhh
10/04/2020, 4:18 PMArkadii Ivanov
10/04/2020, 4:22 PMArkadii Ivanov
10/04/2020, 4:22 PM