Documentation ¶
Overview ¶
Event and Target definition and implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { // Type returns event type. Type() Type // Target returns Target on which event was dispatched. Target() Target // WithTarget returns a copy of this event with a different target. This is // mainly used to forward events to another target. WithTarget(Target) Event // When returns time when event was created. WithXXX events methods shouldn't // change this property. When() time.Time }
Event is a generic interface for all events
type Handler ¶
type Handler interface { id.Identifiable HandleEvent(event Event) }
Handler define an event handler.
func HandlerFunc ¶
type Target ¶
type Target interface { AddEventListener(Type, Handler) RemoveEventListener(Type, Handler) DispatchEvent(event Event) }
Target define an object that can receive events and may have listeners for them.
func NewNoOpTarget ¶
func NewNoOpTarget() Target
NewNoOpTarget returns a new Target that ignore events listener and events.
Click to show internal directories.
Click to hide internal directories.