Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 888 Bytes

README.md

File metadata and controls

46 lines (30 loc) · 888 Bytes

Event Emitter

Event Emitter is lightweight Go package that implements a simple Event Bus.

Go Reference

Installation

go get https://github.com/SakizciAdam/eventemitter

Usage

package main

import (
	"fmt"

	"github.com/SakizciAdam/eventemitter"
)

func main() {
	bus := eventemitter.New()

	testListener := func(args ...interface{}) {
		fmt.Println(args[0])
	}

	bus.AddListener("test", testListener)

	bus.EmitSync("test", "Hellooo world")
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Found an Issue?

Create a bug report!

License

MIT