Go to file
pocke 51c1549540 Write README [ci skip] 2015-01-17 17:55:34 +09:00
.travis.yml travis 2015-01-07 22:41:01 +09:00
LICENSE README [ci skip] 2015-01-07 22:44:35 +09:00
README.md Write README [ci skip] 2015-01-17 17:55:34 +09:00
errors.go Write comments 2015-01-17 17:44:47 +09:00
goevent.go Write comments 2015-01-17 17:44:47 +09:00
goevent_test.go add test 2015-01-12 13:00:07 +09:00
table.go Write comments 2015-01-17 17:44:47 +09:00
table_test.go Off return nil 2015-01-12 12:34:04 +09:00

README.md

Build Status Coverage Status GoDoc

goevent

goevent is event dispatcher written by golang.

example

listen for event

e := goevent.New()
e.On(func(i int, s string){
  fmt.Printf("%d: %s\n", i, s)
})

Trigger

e.Trigger(1, "foo")

Use event table

table := goevent.NewTable()
table.On("foo", func(i int){
  fmt.Printf("foo: %d\n", i)
})
table.On("bar", func(s string){
  fmt.Printf("bar: %s\n", s)
})

table.Trigger("foo", 1)
table.Trigger("bar", "hoge")
table.Trigger("bar", 38)    // retrun error

LICENSE

Copyright © 2015 pocke Licensed [MIT][mit] [MIT]: http://www.opensource.org/licenses/mit-license.php