Skip to content

Commit 4961cec

Browse files
committed
fix(events): one and until not preserving event meta
1 parent 494517a commit 4961cec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/eventEmitter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default function eventEmitter() {
124124
if (typeof fn !== 'function') return this;
125125
function wrapper(...args) {
126126
off(event, wrapper);
127-
fn(...args);
127+
fn.call(this, ...args);
128128
}
129129
return this.on(event, wrapper);
130130
},
@@ -134,7 +134,7 @@ export default function eventEmitter() {
134134
until(event, fn) {
135135
if (typeof fn !== 'function') return this;
136136
function wrapper(...args) {
137-
const ret = fn(...args);
137+
const ret = fn.call(this, ...args);
138138
if (ret instanceof Promise) {
139139
ret.then((val) => val && off(event, wrapper));
140140
} else if (ret) {

0 commit comments

Comments
 (0)