//arrow-fx-coroutines/arrow.fx.coroutines/Atomic/modifyGet

modifyGet

common abstract suspend fun <B> modifyGet(f: (A) -> Pair<A, B>): Pair<A, B>

ModifyGet allows to inspect state A, update it and extract a different state B. In contrast to modify, it returns a Pair of the updated state A and the extracted state B.

See also

common

   
arrow.fx.coroutines.Atomic for an example

Do you like Arrow?

Arrow Org
<