As stated in the Jetpack compose documentation, a stable type must comply with the following contract.
- The result of equals for two instances will forever be the same for the same two instances.
- If a public property of the type changes, Composition will be notified.
- All public property types are also stable.
The first and third contracts are straightforward. How can I comply with the second point?
For example, I have a stable type called User
data class User(val username: String, var email: String)
and I change the email during the flow of the app, how can I notify the Composition?