you could make delegates for your bindings ``` fu...
# android
k
you could make delegates for your bindings
Copy code
fun bindString(@StringRes stringRes: Int) = object : ReadOnlyProperty<Context, String> {
    private var cached: String? = null
    
    override fun getValue(thisRef: Context, property: KProperty<*>): String
            = cached ?: thisRef.getString(stringRes).also { cached = it }
}
val favorites by bindString(R.string.favorites)