itaylor / redux-socket.io

An opinionated connector between socket.io and redux
410 stars 53 forks source link

How can I changed the "catchable" server emit EVENT NAME in the plugin? #34

Open grapewheel opened 7 years ago

grapewheel commented 7 years ago

It seems the socket.io server emit to client 's event name must be "action", like this: Server: socket.emit('action', {type:'message', data:'good day!'});

or the plugin can't catch the server event and reduxed it

How can I changed the "catchable" EVENT NAME ? The { execute: optimisticExecute } can only changed the client emit event name

Ask for hurry, I'm ready to use the plugin in the production!

blazeroot commented 6 years ago

I think you'd want to pass eventName parameter to the createSocketIoMiddleware.

See: https://github.com/itaylor/redux-socket.io/blob/master/src/index.js#L15