-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend event binding with optional context #70
Comments
Go for it. We were talking about that the other day and I think it's a good idea. Let me know if you're hitting any blocker. |
Hi Dirk, Sounds good, I think it makes the code cleaner and as you said, the API is backwards compatible. I'll be happy to merge it into the next JS release. |
I can't seem to figure out how to install all Ruby gems on my machine (OS X Mavericks). Any tips? What kind of configuration are you running it on?
Not familiar with Ruby/gems so there might be an easy fix.. |
Hm, seems like a problem with building ffi, which is a native gem. I am getting a different error if I switch to the system version of Ruby. Ruby bundled with OS X is a bit crap - I would recommend using rbenv (or rvm) to install it properly. Also, you should install gcc, because Apple decided to swap it for clang and it might cause some issues with native extensions. Here are some instructions on how to do that: http://blog.zerosharp.com/installing-ruby-with-homebrew-and-rbenv-on-mac-os-x-mountain-lion/ |
I should document this and pusher-js should use one platform for building and testing - requiring Ruby and Node.js is a bit of a pain. |
Another way is to install Homebrew and then |
Finally managed to install all Ruby related dependencies on a Vagrant box but now I can't install Karma. Guess it has to do with a Python mismatch that's required to compile one of its dependencies (Socket.io > ws). You guys don't happen to have a pre-configured Vagrant box for running these tests? 😆 |
Hi Dirk, I'm sorry this process is so painful - I never had these problems and it seems like I was the only one running tests since 2.0 ;) Don't waste your time on Karma, just test it on Chrome or whatever browser you're using, run the code through jshint (will catch missing semicolons, extra commas, etc.) and that's enough for me :) I will do proper cross-platform testing before releasing the next stable version or release candidate. |
Guess you have to be either experienced with Ruby / Python or have a lot of luck installing compatible versions :D Anyway, I got bin/jasmine running and pushed the changes. Thanks for the tip. |
Released in 2.2.0, closing. Thanks for the PR once again :) |
It's common to add a third "context" argument when binding event handlers in Backbone and many other frameworks. This way you can avoid .bind() on all your callbacks and it eases unbinding:
http://backbonejs.org/#Events-on
Or when applied to Pusher:
This will remain compatible with the current implementation. Would you be interested in a PR for this feature? I'm prepared to add it to the codebase but don't want to maintain a separate fork..
The text was updated successfully, but these errors were encountered: