react-native-use-websocket
react-native-use-websocket copied to clipboard
Websocket subscribe to topic
How to use subscribe to a topic feature in this lib?
basically, the backend is using this lib adonis-websocket-client
here is a function that subscribe
to topic
.
here is an example
this.ws.withJwtToken(this.token).subscribe(channel)
Sending a message to a specific topic
socket.ws.getSubscription(topic).emit(event, message)