Binding to events with Context not working
See original GitHub issuecontext is undefined in following code:
var PUSHER_APP_KEY = '...';
var pusher = new Pusher(PUSHER_APP_KEY);
var channel = pusher.subscribe("test-channel-x");
var context = { title: 'Pusher' };
var handlerSucess = function() {
alert("Subscription succeded with " + this.title);
};
channel.bind("pusher:subscription_succeeded",handlerSucess ,context);
var handlerNew = function() {
alert("new event with " + this.title);
};
channel.bind("new",handlerNew ,context);
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Why does the data binding not work when i set the data ...
In the buttonSave_Click handler, create and set the correct DataContext object (based on provided user input) then call BindingGroup.
Read more >The "event" binding - Knockout.js
The event binding allows you to add an event handler for a specified event so that your chosen JavaScript function will be invoked...
Read more >Events | Maps JavaScript API - Google Developers
MVC events, for example, do not pass arguments within their event. ... API provides the addDomListener() static method to listen to and bind...
Read more >Azure Event Hubs output binding for Azure Functions
This article explains how to work with Azure Event Hubs bindings for Azure Functions. Azure Functions supports trigger and output bindings ...
Read more >ReactJS | Binding Event Handlers - GeeksforGeeks
In ReactJS, we need to bind events so that the this keyword would not return an “undefined“. In this article, we are going...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a work around for now, you could do:
channel.bind(..., handlerSucess.bind(context)
But we should get this fixed. Thanks for letting us know. Are you on PusherJS V3?
No, it was Firefox 46 on Windows 10