Skip to content

Add .onRaw() support, and alias the .emit() method instead of re-doing it

Compare
Choose a tag to compare
@ax4 ax4 released this 09 Jun 12:18
· 4 commits to master since this release

We add the support for .onRaw() feature.

Let's say:

var a = new eventbus()
a.on('event-name', function(eventname, ...data)) {
  //do some code with eventname and ...data in callback
}

a.onRaw('event-name', function(raw, ...data)) {
  //do some code with raw and ...data in callback
}

And also we revert the last versions' quick copy-pasting style of re-coding and change it into an alias function.