Skip to content

jQuery.proxy is compatible? how? #12

@luku

Description

@luku

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'));?
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions