Skip to content

Commit 0a23f18

Browse files
fix undefined context in one method problem
1 parent e04cb8a commit 0a23f18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/api/pub_sub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Pub_Sub.prototype.on = function (publisherName, fn) {
2828
//oneSubscribe
2929
Pub_Sub.prototype.one = function (publisherName, fn) {
3030
if (typeof fn === 'function' && this._publishers.hasOwnProperty(publisherName)) {
31-
const _fn = param => {
32-
fn(param);
31+
const _fn = function () {
32+
fn.apply(this, arguments);
3333
this.off(publisherName, _fn);
3434
};
3535
return this.on(publisherName, _fn);

0 commit comments

Comments
 (0)