block

inline fun <T> T.block(block: () -> Unit): T

Deprecated

This function is deprecated and will be removed in next major release.Use runBlock() instead.

Replace with

import com.parsuomash.affogato.core.ktx.runBlock
runBlock(block)

Return the value before run the execution block.

Example:

var value = "Hello"
val blockString = value.block { string += " World" }
blockString // "Hello"
value //Hello World"

Since

1.1.0

See also

run
with
apply
let
also