events

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter struct {
	// contains filtered or unexported fields
}

func (*EventEmitter) Emit

func (e *EventEmitter) Emit(event string, data ...interface{})

Emit 发送消息

func (*EventEmitter) Off

func (e *EventEmitter) Off(event string, fn interface{})

Off 取消监听

func (*EventEmitter) On

func (e *EventEmitter) On(event string, fn interface{})

On 监听

func (*EventEmitter) Once

func (e *EventEmitter) Once(event string, fn interface{})

Once 监听一次

type EventInterface

type EventInterface interface {
	Emit(event string, data ...interface{})
	On(event string, fn interface{})
	Once(event string, fn interface{})
	Off(event string, fn interface{})
}

EventInterface Events接口

type Handler

type Handler func(args ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL