prependAny method

Socket prependAny(
  1. AnyEventHandler handler
)

Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. The listener is added to the beginning of the listeners array.

@example socket.prependAny((event, ...args) => { console.log(got event ${event}); });

@param listener

Implementation

Socket prependAny(AnyEventHandler handler) {
  _anyListeners.insert(0, handler);
  return this;
}