1
socket.io 연결이있는 상태를 사용자에게 표시하고 싶습니다.이를 위해 사용자에게 알릴 수있는 내용이 있습니다.socket.io에서 여러 이벤트를 수신합니다.
#I can't use `*` because I have some customized events
socket.on 'my_command', =>
set_status "connecting"
socket.on 'connecting', =>
set_status "connecting"
socket.on 'disconnect', =>
set_status "disconnect"
socket.on 'connect_failed', =>
set_status "connect_failed"
이러한 모든 것을 압축하는 방법이 있습니까? 같은 뭔가 :
socket.on 'connecting, disconnect, connect_failed', (name_of_event)=>
set_status name_of_event