hookio/hook.io — Issue #143: Event sender in listener on() and onAny() context objects
Author: emsten
Created: 2011-12-26 16:35:13+00:00
State: open

In the listener callback I'd like a parameter `this.sender` that either is equal to `this.name` or one of the known hooks in `this._names`.

I've been coding on an app that has a "proxy hook" that relays event from a browser hook, and then can connect to different hooks on the network to which it will pass on events generated from the browser hook.

( BrowserHook -> WebserverHook ) -> ( ClientHook -> External hook cloud )

I don't want to relay events generated from the hook itself. My problem is: how do I tell who generated the event? Parsing the `this.event` by splitting on "::" doesn't work for two reasons: it doesn't work if the generate has the name of the hook, and more importantly, it must specifically check that the name part does not equal `hook` or `error`. All in all, this procedure seems quiet involved and error prone.

Fill me in if I'm missing something! Otherwise I'll throw myself at it!