Hello, how do I treat every new parameter as not e...
# compose
n
Hello, how do I treat every new parameter as not equal with the previous one even if the instance is the same? I have a pulse component and for testing I just send consecutive
Up
objects but it just reflects the first one not others(see the first row). I set
neverEqualPolicy
but it doesn’t work, tho. What is your take for such cases? Thanks!
Copy code
val state = remember { mutableStateOf(initial, neverEqualPolicy()) }
Copy code
sealed class PerformancePulseUpdate : Serializable {
    object Up : PerformancePulseUpdate()
    object Down : PerformancePulseUpdate()
    object None : PerformancePulseUpdate()
}
z
Need to see more code to troubleshoot, but this just looks like an antipattern. Your update objects are events by definition—an update is something is “happens”, not something that “is”—so you're going to be swimming upstream all the way if you try to treat them as state.
n
Hello, thank you! Created a gist for you including all classes https://gist.github.com/nuhkoca/ede72676aeb47960a5990ebbfdaea381