#lazydeferred
Explore tagged Tumblr posts
jacob-cs · 5 years ago
Text
kotlin delegation ‘by’
Tumblr media
https://youtu.be/YogGlRYCfp0?t=285
처음 시작은 위의 코드를 보고 알아 보게 되었다.
.
.
interface delegation에 대하여
https://youtu.be/zfiohSIZtbo
https://youtu.be/JolUNygXu3s
.
.
property delegation에 대하여
https://kotlinlang.org/docs/reference/delegated-properties.html
.
.
lazy 에 대하여
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-lazy/
https://www.youtube.com/watch?v=orUgnUuYW44
.
.
lazyDeferred의 구현 예시 
https://stackoverflow.com/questions/57447027/how-to-refresh-viewmodel-data-using-kotlin-lazy-loading-coroutine
fun <T> lazyDeferred(block: suspend CoroutineScope.() -> T): Lazy<Deferred<T>> {    return lazy {        GlobalScope.async {            block.invoke(this)        }    } }
0 notes