<https://medium.com/@elye.project/using-kotlin-tak...
# feed
v
Why use
apply
in cases like
takeIf { status }?.apply { doThis() }
? I mean, you don't use the modified
this
, and you don't apply anything to anything. You just run some code. Like
takeIf { status }?.run { doThis() }
😉
d
I prefer to use regular
if
for immutable `val`as it is more readable for newcomers to Kotlin
👍 1