https://github.com/night-codes/go-events
Golang events emmiter
https://github.com/night-codes/go-events
Last synced: 2 months ago
JSON representation
Golang events emmiter
- Host: GitHub
- URL: https://github.com/night-codes/go-events
- Owner: night-codes
- License: wtfpl
- Created: 2016-12-14T17:44:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T12:51:18.000Z (almost 5 years ago)
- Last Synced: 2025-01-23T23:32:54.495Z (4 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-events
Golang event emmiter library## Example
```go
package mainimport (
"fmt"
"github.com/night-codes/go-events"
"strconv"
)var (
myEvent = events.New()
)func main() {
for i := 0; i < 10; i++ {
l := i
myEvent.On(func(data ...interface{}) {
fmt.Println("Listener"+strconv.Itoa(l), data[0])
})
}
for j := 0; j < 10; j++ {
fmt.Println("")
myEvent.Emit("Event" + strconv.Itoa(j))
}
}
```## License
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004Copyright (C) 2016 Oleksiy Chechel
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION0. You just DO WHAT THE FUCK YOU WANT TO.