I’d name a property like onClickListeners . The short version works great only for DSLs where you are defining your listiners “in place”. Usually, in a typical Kotlin DSL, the default behavior shoud be to add a new listener to the internal list, since that is consistent with how other DSL constructions typically work:

parent {
child { … }
child { … }
onClick { … }
onClick { … }
}

Written by

Project Lead for the Kotlin Programming Language @JetBrains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store