pardom05/24/2020, 6:41 PM
Michal Harakal06/01/2020, 4:34 PM
for binding MVU model to Jeppack’s model. But I don’t get it about lifecycle, who is reposnsible for that? I’ve seen in other sample use of Android’s ViewModel bound with using
to Jetpack. Also you are using `@Model`which is already deprecated with dev12. Also looking forward to see iOS part …
pardom06/01/2020, 5:08 PM
process and is therefore independent of any
. When an
(in this case there is only one) has a configuration change (e.g. orientation change), it will first remove its render function from the runtime here: https://github.com/pardom/lambda-news/blob/master/lambda-news/android-compose/src/main/java/news/lambda/android/AppActivity.kt#L46. Then when the new activity is created, it will provide its render function to the runtime here: https://github.com/pardom/lambda-news/blob/master/lambda-news/android-compose/src/main/java/news/lambda/android/AppActivity.kt#L42. That is all that is needed handle configuration change because the runtime is not part of the activity. An Oolong user may not like this approach, in which case you can host the runtime in a
. The UI state is managed by the runtime and job of Android/Compose is to simply provide dependencies and render UI.
, this has nothing to do with the lifecycle, but rather delegation to child components (i.e. screens). The root component of the app delegates to child components by wrapping their model/msg/props.
is a function that allows you to easily map from a child
to the root `Dispatch<AppMsg>`: https://github.com/pardom/lambda-news/blob/master/lambda-news/view/src/main/kotlin/news/lambda/app/component/AppComponent.kt#L45
should help in understanding it: https://github.com/oolong-kt/oolong/blob/master/oolong/src/commonMain/kotlin/oolong/dispatch/util.kt#L36
, a function
, and returns a
(B) -> A
which helps in delegating from a parent
to a child
I plan to migrate soon, but I’m waiting for the next version of AS Preview. Canary 10 is pretty laggy. 😬
Michal Harakal06/01/2020, 6:25 PM
pardom06/01/2020, 6:54 PM
for me is important to know, that ModelView is not necessary and we can have perfectly multiplatform sharable code with MVU (stiil keeping iOS in mind), just reimplementing the render function.That was one of the primary goals with Oolong. The platform is not the problem domain, so it shouldn't be coupled to your domain logic. Nor should it concern itself with what to render, but rather how.