forcelain
10/04/2018, 8:03 AMprivate val items : MutableList<String> by lazy {
// a lot of init code
}
how do I exclude my initialisation code into a separate function? I can think of creating something like
private val items : MutableList<String> by lazy {
init()
}
fun init() : MutableList<String> {...}
but maybe there is more elegant waydiesieben07
10/04/2018, 8:05 AMby lazy(::myFunction)
by lazy(::init)
.forcelain
10/04/2018, 8:07 AMdiesieben07
10/04/2018, 8:08 AMforcelain
10/04/2018, 8:08 AMdiesieben07
10/04/2018, 8:08 AMcurry
. But I think that is a bit overkill here.