Adapter constructor declaration
class YourAdapter(private val mListener: (ItemObject) -> Unit) : RecyclerView.Adapter()
Adapter::onBindViewHolder
holder.itemView.setOnClickListener {
mListener.invoke(item) // <- item instance of ItemObject
}
How to Use
mTypesWasteAdapter = YourAdapter({ it.something()})
Basically, you will receive the ItemObject as it
in the lambda argument.