advise Add Remove
open fun adviseAddRemove(lifetime: Lifetime, handler: (AddRemove, K, V) -> Unit)
Content copied to clipboard
Adds a subscription to additions and removals of map elements. When a map element is updated, the handler is called twice: to report the removal of the old element and the addition of the new one.
The subscription is removed when the given lifetime expires.