Documentation ¶
Overview ¶
Package event is a simple event emitter for Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFunc = errors.New("listener value is not a function")
ErrNotFunc presented when an invalid argument is provided as a listener function.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Recoverer Recoverer // contains filtered or unexported fields }
Event implementation.
func (*Event) On ¶
func (e *Event) On(listener interface{})
On subscribes a function as new event listener.
func (*Event) Once ¶
func (e *Event) Once(listener interface{})
Once subscribes a function as new event listener. This function will be called only once.
func (*Event) Trigger ¶
func (e *Event) Trigger(arguments ...interface{})
Trigger the event. This will call all function listeners.
func (*Event) TriggerWait ¶
func (e *Event) TriggerWait(arguments ...interface{})
TriggerWait triggers the event and waits for all functions to execute.
Click to show internal directories.
Click to hide internal directories.