https://kotlinlang.org logo
Title
m

Mario Adam

05/03/2023, 10:08 AM
Hi - given a login use case, where a user has to login by providing username, password and a region. The region is picked from a dropdown which is populated with values by an async api call. So I have those composables • LoginForm ◦ RegionPicker ◦ UserNameInput ◦ PasswordInput ◦ LoginButton What is best practice: having a viewmodel on LoginForm handling both the api request for regions and login (loading the regions as a
LaunchedEffect
on the LoginForm? Or having a viewmodel on the LoginForm for login and a separate viewmodel on the RegionPicker (with a
LaunchedEffect
in this sub-component)?
r

Rob Elliot

05/03/2023, 10:13 AM
This sounds like it's specific to some framework? #android , or #compose?