Skip to content

Instantly share code, notes, and snippets.

@jangalinski
Created February 11, 2019 20:49
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 jangalinski/106f08caa8c5a4bf3da13b7734c50b31 to your computer and use it in GitHub Desktop.
Save jangalinski/106f08caa8c5a4bf3da13b7734c50b31 to your computer and use it in GitHub Desktop.
kotlin property delegate
class Foo {
private var count = 0
private fun count(): Int = ++count
val eager get() = count()
val lazy by lazy { count() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment