Skip to content
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

jQuery.proxy is compatible? how? #12

Open
luku opened this issue Oct 1, 2015 · 0 comments
Open

jQuery.proxy is compatible? how? #12

luku opened this issue Oct 1, 2015 · 0 comments

Comments

@luku
Copy link

luku commented Oct 1, 2015

Hi,
thanks a lot for awesome pub-sub implementation!
Not sure if it's bug, or if I'm missing something, so let's call this issue a question first. Readme states:
... In addition, should you need it, these methods are fully compatible with the jQuery.proxy() method, in case you not only want more control over to which context the subscribed callback is bound, but want to be able to very easily unsubscribe via callback reference. ...

However, I don't think it does or don't understand how I could bind custom context to subscribed callback. Because it always falls back to the main o object: o.trigger.apply(o, arguments);

Could you please add example of $.proxy usage into readme in the case it's really possible?

Have a nice day,
Luk

PS: Perhaps you mean it is compatible with jQuery.proxy when supplying the callback: $.subscribe('foo', $.proxy(createLogger, $someContext, 'foo'));?
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant