I referred Socket.io : How do I handle all incoming messages on the server? answered by Ganesh Kumar to override the on() but i am unable to pass a callback function as argument. Why is it so? Can't i pass callback function in this?
My code snippet is like:
socket.$emit = function(callback)
{
....
callback()
}
It is flagging error and treating callback as string. Am I doing something wrong?