I've done that already @André Kindwall.
Here is a full implementation of my
SnapshotMutationPolicy
Copy code
private object AlwaysApplyPolicy : SnapshotMutationPolicy<String> {
override fun equivalent(a: String, b: String): Boolean = false
override fun merge(previous: String, current: String, applied: String): String? {
return current
}
override fun toString() = "AlwaysApplyPolicy"
}
Rafs
11/23/2021, 8:55 AM
What I want is for the
State
backed by this snapshot policy to always force a recomposition when it's value get's set, even if the previous value is equal to the current value.
a
André Kindwall
11/23/2021, 12:43 PM
You should probably ask a new question where you describe what you want to achieve, not how you think you can achieve it (the xy problem).
It sounds to me like you are trying to trigger some event, if that is the case then that should be handled by collecting a flow inside a sideeffect