SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
291 stars 92 forks source link

What are mandatory event callbacks? #94

Closed sunkibaek closed 6 years ago

sunkibaek commented 6 years ago

So far I know my app will crash if I don't have a callback for error event. What else event must have its callback to prevent errors?

jondubois commented 6 years ago

@sunkibaek There are no mandatory error events but if you're running the client inside Node.js then you should handle it, otherwise the process will crash because Node.js crashes when there are uncaught errors. That said it's highly recommended that you always handle it (including on the front end).

When emitting events on a socket, the handler is 100% optional.