Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler allows callback registration and event fireing, its simply a way of comunication that comes handy in some cases, though is has performance cost, events are mapped to reflect.Type of an inputted anything, enum events are accessed by indexing into slice, if you don't have to pass arguments with event use Handler.Trigger and Handler.Run as it is cleaner and faster
func (*Handler) Fire ¶
func (e *Handler) Fire(ev interface{})
Fire launches all event callbacks for given type
type Listener ¶
type Listener struct { Name string Block bool Runner StringRunner // contains filtered or unexported fields }
Listener holds function tha gets called when event is triggered if events returns true, all consequent events will get blocked, execution goes from newest to oldest event listener
type String ¶
String handles event registration for elements
type StringRunner ¶
type StringRunner func(i interface{})