The Wayback Machine - https://web.archive.org/web/20210614213049/https://github.com/topics/event-listener
Skip to content
#

event-listener

Here are 150 public repositories matching this topic...

RelicOfTesla
RelicOfTesla commented Mar 24, 2021
func makeFn(a int) event.ListenerFunc {
	return func(e event.Event) error {
		fmt.Println(a)
		return nil
	}
}
func main() {
	evBus := event.NewManager("")
	f1 := makeFn(11)
	evBus.On("evt1", f1)
	f2 := makeFn(22)
	evBus.On("evt1", f2)
	evBus.RemoveListener("evt1", f1) // DON'T REMOVE ALL !!!
	evBus.MustFire("evt1", event.M{"arg0": "val0", "arg1": "val1"})
}

Improve this page

Add a description, image, and links to the event-listener topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the event-listener topic, visit your repo's landing page and select "manage topics."

Learn more