what will be the main difference between if I crea...
# compose-android
m
what will be the main difference between if I create a
data class
or
sealed class
for the UI state?
a
for starters, you wouldn't be able to instantiate that sealed class unless you subclass it to a class. 2ndly, Another difference would be the lack of a copy method, which I happen to use most times I am doing UI states
👍 1
🤔 1
x
The recommendation is to always use data classes for stability reasons
👍 1