getAndUpdate

fun getAndUpdate(function: (V) -> V): V

Updates the MutableStateFlow.value atomically using the specified function of its value, and returns its prior value.

function may be evaluated multiple times, if value is being concurrently updated.

update will also call put.

Since

0.5.6