david-wg2
04/04/2019, 2:53 PMitems.onEach
?Luke
04/04/2019, 2:54 PMonEach
still works with it
david-wg2
04/04/2019, 2:55 PMapply
Dias
04/04/2019, 3:10 PMthis
?Luke
04/04/2019, 3:14 PMitems.applyOnEach { this.attribute = "something" }
, that would be greatDias
04/04/2019, 3:38 PMfun <T> Collection<T>.applyOnEach(block: T.() -> Unit) {
this.forEach {
it.apply(block)
}
}
Alowaniak
04/04/2019, 3:55 PMit
to do the applying and pass that to the forEachLuke
04/04/2019, 4:10 PMzhuinden
04/04/2019, 4:39 PMinline fun <T> Collection<T>.forEachApply(block: T.() -> Unit
like said above, and it would work greatnkiesel
04/05/2019, 6:47 AMitems.map { it.attribute = "something" }