icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
997 stars 95 forks source link

Separate library to multiple artifacts #65

Closed ausichenko closed 3 years ago

ausichenko commented 3 years ago

It would be nice to see the new moko-viewmodel or moko-mvvm-viewmodel library. Without databinding support for declarative UI - Jetpack Compose.

And the moko-mvvm library can be updated by composing from moko-viewmodel, moko-livedata (for the future, as an example)

ln-12 commented 3 years ago

I would also like to see the equivalent for https://developer.android.com/jetpack/compose/state#viewmodel-and-jetpack-compose

Alex009 commented 3 years ago

@ln-12 what exactly you like to see? moko-mvvm provide original jetpack's viewmodels, so all integration with compose is already available

Alex009 commented 3 years ago

Suggested modules:

ln-12 commented 3 years ago

@Alex009 For example the ViewModel for login feature section in the readme only deals with data bindings. It would be nice to see it with compose :)

Link184 commented 3 years ago

Suggested modules:

  • mvvm-viewmodel (viewmodel, eventdispatcher)
  • mvvm-livedata (livedata, transform, state)
  • mvvm-databinding (all databinding, depends on viewmodel, livedata)
  • mvvm (depends on all modules)

for mvvm-viewmodel I think viewmodel should be a mandatory part of mvvm architecture at leas because the last 2 letters from mvvm means viewmodel. Also I think another dependencies(like databinding or uicompose) should be delivered separately because they have nothing in common with mvvm principles, they should act more like additional helper tools, maybe connected like plugins(like gson-converter for retrofit). That means less dependencies and less potential dependencies conflicts and frustrations on consumer projects.

Alex009 commented 3 years ago

will be released in 0.9.0