-
-
Save LouisCAD/7ce3a30cb88c27858b12d5f26c118b0b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import java.lang.ref.WeakReference | |
| import kotlin.reflect.KProperty | |
| class WeakRef<out T>(value: T) { | |
| private val ref = WeakReference<T>(value) | |
| operator fun getValue(thisRef: Any?, property: KProperty<*>): T? = ref.get() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment