mixins/socket¶
SocketMixin¶
SocketProxy¶
-
class
SocketProxy(socketContext)¶ Warning
This class is not exportet and its instances are only available throug the implementers of the
SocketMixin().A lightweight socket proxy implementation that basically yields the emitter-like
emit()andon()methods. Internally, these calls are forwarded to the globalvispa.socketinstance with socketContext being prefixed to all events.Arguments: - socketContext (String) – See
socketContext.
-
read-only
socketContext¶ Type: String The socket context which is used to as a prefix for all events.
-
emit(event, ...)¶ Emits an event with all supplied arguments.
Arguments: - event (String) – The name of the event to emit to.
-
on(event, callback)¶ Listens to an event with a callback.
Arguments: - event (String) – The name of the event to listen to.
- callback (Function) – The callback function that is invoked with all arguments supplied in the corresponding event emission.
- socketContext (String) – See