update

inline fun update(updater: T.() -> T)

Update the Mutable via an extension function. Within the function, the receiver will be the old value of the Mutable, and the function must return a replacement value.

Parameters

updater

An extension function taking a receiver T, the old value, and returning the replacement value.