Open CXwudi opened 1 week ago
Decompose works, next on MVIKotlin and configuration change
MVIKotlin and configuration change data restoration succeed. The MVIKotlin and Decompose libraries are so well designed that it is so robust and feature-rich yet extendible.
Next move on to the last missing piece of puzzle: Koin
Koin initial PoC result:
single { SomeComponent() { get<AnotherComponent>()} }
. However, once again the AnotherComponent
can possible also need another callback. Hence a chain of callback is unavoidable and hence not possible to let Koin manage all the Decompose component creation.DefaultComponentContext
by hand
initKoin()
function that pass the DefaultComponentContext
into it would be a feasible solutionMove on to next and the last POC 😄: Sharing services or classes with multiple Decompose component
Be aware of the LifeCycle
and Android condiguration change thing
Successfully finished all PoC 🎉🎉🎉
The Koin looks like can survive configuration change, and so does all dependencies inside Koin, because we created a service without any handling of configuration changes, but it is still surviving. First guess is that we need to ask a question in koin slack to see why my dependencies survive the configuration changeandroidContext {}
call in koinApplication {}
makes all dependencies survive
Koin slack confirm that something is happening causing the unexpected surviving behaviour. We need a minimal reproducible sample, without Decompose and mvikotlin involved.
Back in song finder vocab app, we made an innovative architecture based on DI and MVVM. We introduced a new concept called state model that basically shares state values between multiple view model. However the architecture lacks proper handling of navigation, android configuration change, etc.
Question: can DI and state model things still works using MVIKotlin and Decompose?