Equanox/gotron

Refactor window.On to accept String as Event

ysweid opened this issue · 0 comments

I started to play with gotron yesterday, it is annoying fact that we need to construct a struct in order to start listening to an event.

window.On(&gotron.Event{Event: "event-name"}, func(bin []byte) {
	//Handle event here
}

It will be such cleaner API, if On method can accept String param as following:

window.On("event-name", func(bin []byte) {
	//Handle event here
}