You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
424 B
Kotlin
26 lines
424 B
Kotlin
package me.eater.threedom.event
|
|
|
|
import me.eater.threedom.dom.INode
|
|
|
|
class Event<out T>(val data: T, val source: INode<*>) {
|
|
|
|
var bubble = true
|
|
private set
|
|
|
|
var propagate = true
|
|
private set
|
|
|
|
fun stopPropagation() {
|
|
propagate = false
|
|
}
|
|
|
|
fun stopBubbling() {
|
|
bubble = false
|
|
}
|
|
|
|
operator fun component1(): T = data
|
|
operator fun component2(): INode<*> = source
|
|
}
|
|
|
|
|