Cody Engel
10/24/2019, 5:00 AM@Model
class Name(var name: String = "Android") : ViewModel()
But inheritance isn’t currently supported for Model objects.
We currently use LiveData a lot today but with Compose it seems like unnecessary overhead.themishkun
10/24/2019, 6:27 AM@Model
tries to do to register observables. Do you really want that? Just use composition over inheritance and smack that @Model
as a property of your ViewModel. But before that, try to think: do you even need a ViewModel in the first place?Luca Nicoletti
10/24/2019, 7:42 AMGeorge Mount
10/24/2019, 2:55 PMLuca Nicoletti
10/24/2019, 3:00 PMCody Engel
10/24/2019, 3:27 PMChuck Jazdzewski [G]
10/24/2019, 5:07 PM@Model
classes is in the plan but is not currently supported.Luca Nicoletti
10/24/2019, 5:08 PMChuck Jazdzewski [G]
10/24/2019, 5:10 PM@Model
lowering transform to support inheritance. The state record needs to inherit from the ancestor state record which is admittedly not that difficult to implement but I have not gotten to it yet.Cody Engel
10/24/2019, 5:44 PMthemishkun
10/24/2019, 9:45 PMCody Engel
10/24/2019, 9:58 PMthemishkun
10/25/2019, 5:46 AM