Skip to content

Commit

Permalink
set callback context
Browse files Browse the repository at this point in the history
  • Loading branch information
pehrlich committed Mar 6, 2012
1 parent 3f488a8 commit 8e66134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pusher_event_dispatcher.js
Expand Up @@ -45,7 +45,7 @@ Example:
var callbacks = this.callbacks[event_name];
if (callbacks) {
for (var i = 0; i < callbacks.length; i++) {
callbacks[i](data);
callbacks[i].call(this, data);
}
} else if (this.failThrough) {
this.failThrough(event_name, data)
Expand Down

1 comment on commit 8e66134

@pehrlich
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this works because event dispatcher extends channel, as seen here: https://github.com/pusher/pusher-js/blob/master/src/pusher_channels.js#L66

Please sign in to comment.