Created
May 2, 2020 10:13
-
-
Save aasitnikov/e8c6b408e5ae0baa3945f90fe2fde285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T> createSingleton(provider: () -> T): () -> T { | |
val lazy by kotlin.lazy(provider) | |
return { lazy } | |
} | |
fun <T> createLazy(provider: () -> T): dagger.Lazy<T> { | |
val lazy by kotlin.lazy(provider) | |
return dagger.Lazy { lazy } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment