withSetter
Returns a new MutableState that calls setter instead of doing the actual value update.
IMPORTANT: You must manually set value =
on the underlying MutableState. The setter gets the underlying MutableState via this
.
This can be used to wrap a MutableState with extra update logic. For simpler use cases you might prefer beforeUpdate/afterUpdate instead.