SignalR JavaScript client universal trigger -


i need attach event every hub.client method. example:

 hub.client.dosomething = function (e) {           afunction(e);         };      hub.client.dosomethingelse = function (e) {           afunction(e);         }; 

is there way attach afunction() client methods on client level, without placing function in each client method?

i don't know such callback available directly on hub proxy, use received callback on connection object. (see list of connection lifetime events , received definition)

be aware received callback called every time data received connection, means, if have multiple hubs, invoked when of hub send data client. means, have inspect data received in callback , decide, if should process data (if belongs given hub, if real message, or signalr internal message).


Comments

Popular posts from this blog

javascript - Complete OpenIDConnect auth when requesting via Ajax -

apache - PHP Soap issue while content length is larger -

c# - Replace text in MailItem Body -