callback

fun <T> callback(capture: Capture<T> = void(), callback: (T) -> Unit): Capture<T>

Creates a Capture that calls callback on each element and stores values in capture (by default it is void).