All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.harmony.kotlin.common.Delegates.kt Maven / Gradle / Ivy

package com.harmony.kotlin.common

import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty

object Delegates {

  fun  weakReference(value: T):
    ReadOnlyProperty = object : ReadOnlyProperty {
    private val reference = WeakReference(value)
    override fun getValue(thisRef: Any?, property: KProperty<*>): T? = reference.get()
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy