on
inline fun <Parent, Child : Any> Parent.on(instanceof: KClass<Child>, block: Child.() -> Unit): Parent
Executes the block if the Parent is an instance of type Child.
// Chained function call alternative to:
receiver.also { if(this is Child) block(this) }
// Example usage:
receiver.on(Child::class) { ... }
Content copied to clipboard
Return
The original Parent object.