afterUpdate

fun <T> MutableStateFlow<T>.afterUpdate(setter: (T) -> Unit): MutableStateFlow<T>

Returns a new MutableStateFlow that calls setter after doing the actual value update.

The value is set automatically for you before setter has been called. For more control use withSetter. This can be used to wrap a StateFlow/MutableStateFlow with extra update logic.