xavi-js/xavi-client — pull request #8 by lipsmack (2014-02-18 17:29:13+00:00)
Title: Allows event listeners to be triggered in a custom context

For convenience, it should be possible to dispatch event listeners in a custom context. The alternative is to bind the context when creating the event listener - `client.on("channel", "command", fn.bind(this))` - which makes unbinding more challenging (`fn.bind(this) === fn.bind(this); // false`).

Where a context is not supplied, the listener should trigger in its existing context.