Skip to content

Instantly share code, notes, and snippets.

@DawnImpulse
Created March 7, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DawnImpulse/2d99249af579bb2fd40b7c86a3d48dd7 to your computer and use it in GitHub Desktop.
Save DawnImpulse/2d99249af579bb2fd40b7c86a3d48dd7 to your computer and use it in GitHub Desktop.
init mutable live data by lazy
private val randomImages : MutableLiveData<List<ObjectImage>> by lazy {
MutableLiveData<List<ObjectImage>>().also {
GlobalScope.launch {
CtrlImage.random(limit)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment