socket.io-emitter-middleware
Redux middleware to emit actions to a socket.io server
API
Apply middleware
;; ; ; const socket = io; const store = ;
socketIOEmitterMiddleware
receive asocket
instance created byio.connect(<url>)
.
Example action
const action = type: 'JOIN_GAME' payload: username: username socket: send: channel: '/game' namespace: 'ns' room: 'room' ;
payload
(optional) is the data passed to the socket.io server.socket.channel
define the socket.io channel to use to emit the action.socket.namespace
(optional) use the given namespace, instead of the default, to emit the action.socket.room
(optional) emit the action to the given room, instead of a global broadcast.