Releases: DanmakuTree/ts-event-bus
Releases · DanmakuTree/ts-event-bus
add error catch if callback fails
v1.0.3
Add .onRaw() support, and alias the .emit() method instead of re-doing it
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.
Split the .emit() and .emitContext() method
Just copy, paste, comment, and split the method into two, because we're lazy to call context. This copy-paste is too rude, I should make an alias function instead of doing this.