itaylor / redux-socket.io

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

At the client side, where to implement the .on('event')? #41

Closed lai32290 closed 5 years ago

lai32290 commented 5 years ago

In my application I need to listen for event sent from server side, so I'll have to implement the .on('my_event', data => { ... }) to dispatch the event data.

Where should I implement it?

lai32290 commented 5 years ago

I just figured out that it's going to listen for "action" event.

socket.on('action', dispatch) // default behavior