Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "1.0.9"
Version is the current version of the package.
Functions ¶
This section is empty.
Types ¶
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
EventEmitter is a simple event emitter.
func (*EventEmitter) Emit ¶
func (e *EventEmitter) Emit(typ string, payload any)
Emit emits an event.
func (*EventEmitter) Off ¶
func (e *EventEmitter) Off(typ string, handler Handle)
Off removes specify the given event type.
func (*EventEmitter) On ¶
func (e *EventEmitter) On(typ string, handler Handle)
On registers a handler for the given event type.
func (*EventEmitter) Once ¶
func (e *EventEmitter) Once(typ string, handler Handle)
Once performs exactly one action.
type Handle ¶
Handle is a function that can be registered to an event.
func HandleFunc ¶
HandleFunc creates a Handle from a function.
Click to show internal directories.
Click to hide internal directories.