Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 4b2f0e3

Browse files
committed
cleanup
1 parent 0a01bae commit 4b2f0e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ function initEvents() {
2626
if (events) {
2727

2828
forEach(events, (listeners, event) => {
29-
if (typeof listeners === 'string') {
30-
const name = listeners;
31-
listeners = (...args) => {
32-
this[name].apply(this, args);
33-
};
34-
}
29+
3530
forEach(isArray(listeners) ? listeners : [listeners], listener => {
3631

3732
var priority = 0;
@@ -41,6 +36,11 @@ function initEvents() {
4136
listener = listener.handler;
4237
}
4338

39+
if (typeof listener === 'string') {
40+
const name = listener;
41+
listener = (...args) => this[name].apply(this, args);
42+
}
43+
4444
_events.push(Events.on(event, listener.bind(this), priority));
4545
});
4646
});

0 commit comments

Comments
 (0)