Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 723 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 723 Bytes

Wardrum - Go Event Emitter

Streamline your Golang application's event handling with our lightweight and intuitive event emitter library. Easily emit and listen to events, fostering dynamic communication between components. Simplify development and create more responsive systems with the power of event-driven architecture.

Installation

go get github.com/b5710546232/wardrum

How to use

func main() {
	emitter := wardrum.NewEventEmitter[string](
		wardrum.SetHistorySize[string](3),
	)

	listener := wardrum.NewListener(func(data string) {
		fmt.Println("Received data:", data)
	})

	wardrum.On(emitter, "exampleEvent", listener)

	wardrum.Emit(emitter, "exampleEvent", "Hello world")
}