<@U2W6BJ91R> Thank you, but I'm aware of that, tha...
# getting-started
f
@okkero Thank you, but I'm aware of that, that's also what they say in the SO post I linked. I was just having a hard time imagining how I was supposed to do it the right way. But it seems like I've just figured it out. I've currently created a var in the adapter as:
Copy code
var onArtistClickListener: ((artist: ArtistModel) -> Unit)? = null
Which I can then set normally as:
Copy code
chartAdapter.onArtistClickListener = { Timber.d("Start new controller for $it") }
And then use with `invoke`:
Copy code
chartViewHolder.container?.setOnClickListener {
    onArtistClickListener?.invoke(artists[chartViewHolder.adapterPosition])
}
So that should be the right way (I hope)
­čĹŹ 1