Open graforlock opened 6 years ago
Hey! Yup the design is to enable pattern matching, and socket.io’s design is closely tied to JS and it’s semantics. Why would you like to send stringly-typed messages?
One good reason could be to communicate with an existent backend/frontend. In which case I could imagine exposing some unsafe functions.
Yes that is correct, if either is in another language or stack, the API should provide some flexibility for such case.
I believe Socket.on is not generic enough, as it stand now it is:
But looking at the docs Socket.IO Documentation, socket.io should support different types of events:
So the above would be like this:
The design decision here is however to support switch statement match; shouldn't user have option to do it the standard way through optional parameter?