Join Slack
I'm working on a chat feature with a `ChatViewModel` that manages multiple states (selected models, ...
# compose
y
Yassine Abou
04/18/2025, 7:58 PM
I'm working on a chat feature with a
ChatViewModel
that manages multiple states (selected models, messages, history) and has lots of functions. It feels overwhelming and hard to maintain. Here’s my
code
. Any tips to simplify this?
c
Chrimaeon
04/18/2025, 8:16 PM
extract some logic to use cases. see the now in android app for examples.
https://github.com/android/nowinandroid/tree/689ef92e41427ab70f82e2c9fe59755441dea[…]rc/main/kotlin/com/google/samples/apps/nowinandroid/core/domain
✅ 1
Chrimaeon
04/18/2025, 8:17 PM
also your question is not really Kotlin related. you’d better ask in an Architecture Forum.
y
Yassine Abou
04/18/2025, 8:19 PM
Christain, thanks for the help. the response was quick ad I really appreciate that🙏
👍🏼 1
30
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by