updateAndGet

fun <T> StateContainer<T>.updateAndGet(updater: (T) -> T): T?

Updates the state and returns the new state if successful, or null if failed.