From 8a619f3166bd0c5a93e623d82e5f58a34a12bbe7 Mon Sep 17 00:00:00 2001 From: Yang Bo Date: Mon, 25 Mar 2019 17:08:11 +0800 Subject: [PATCH] Add constructor for toggle, input, and change events --- .../scala/com/thoughtworks/binding/LatestEvent.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/scala/com/thoughtworks/binding/LatestEvent.scala b/src/main/scala/com/thoughtworks/binding/LatestEvent.scala index e09d293..eb29034 100644 --- a/src/main/scala/com/thoughtworks/binding/LatestEvent.scala +++ b/src/main/scala/com/thoughtworks/binding/LatestEvent.scala @@ -38,6 +38,15 @@ class LatestEvent[E <: Event](eventTarget: EventTarget, eventType: String) exten } object LatestEvent { + def toggle(eventTarget: EventTarget) = { + new LatestEvent[Event](eventTarget, "toggle") + } + def input(eventTarget: EventTarget) = { + new LatestEvent[Event](eventTarget, "input") + } + def change(eventTarget: EventTarget) = { + new LatestEvent[Event](eventTarget, "change") + } def abort(eventTarget: EventTarget) = { new LatestEvent[Event](eventTarget, "abort") }