Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 17, 2022 13:36
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 ch8n/6f1b52a31c325165b99f050fbd225927 to your computer and use it in GitHub Desktop.
Save ch8n/6f1b52a31c325165b99f050fbd225927 to your computer and use it in GitHub Desktop.
state and mutable state delegates
inline operator fun <T> State<T>.getValue(thisObj: Any?, property: KProperty<*>): T = value
inline operator fun <T> MutableState<T>.setValue(thisObj: Any?, property: KProperty<*>, value: T) {
this.value = value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment