mixins/socket ============= SocketMixin --------------- .. js:mixin:: SocketMixin(socketContext) Mixin that provides websocket functionality. :param String socketContext: See :js:attr:`SocketProxy.socketContext`. .. js:attribute:: socket read-only :type: SocketProxy The contained socket proxy instance. SocketProxy ----------- .. js:class:: SocketProxy(socketContext) .. warning:: This class is not exportet and its instances are only available throug the implementers of the :js:mixin:`SocketMixin`. A lightweight socket proxy implementation that basically yields the emitter-like :js:func:`emit` and :js:func:`on` methods. Internally, these calls are forwarded to the global ``vispa.socket`` instance with *socketContext* being prefixed to all events. :param String socketContext: See :js:attr:`socketContext`. .. js:attribute:: socketContext read-only :type: String The socket context which is used to as a prefix for all events. .. js:function:: emit(event, ...) Emits an *event* with all supplied arguments. :param String event: The name of the event to emit to. .. js:function:: on(event, callback) Listens to an *event* with a *callback*. :param String event: The name of the event to listen to. :param Function callback: The callback function that is invoked with all arguments supplied in the corresponding event emission.