Rafs
11/22/2021, 9:52 PMMutableState
variable, including when the contents are the same? I've Tried creating my own SnapshotMutationPolicy
but the merge
method never gets called.André Kindwall
11/23/2021, 2:46 AMequals()
function and return false I guesstad
11/23/2021, 3:29 AMAndrew Neal
11/23/2021, 3:39 AMRafs
11/23/2021, 8:46 AMSnapshotMutationPolicy
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"
}
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.André Kindwall
11/23/2021, 12:43 PMtad
11/23/2021, 5:49 PM