Client API

reco_luan

useClientSocket

  • Type: { on: (event: string, handler: (data: any) => void) => void; send: (event: string, data: any) => void; }
  • Description: The client communicates with the server.
  • Example:
import { useClientSocket } from 'revili/client'

const socket = useClientSocket()

socket?.on('event-name', (data: any) => {
  // ...
})

socket?.send('event-name', 'message')
Last Updated 12/1/2024, 5:08:39 PM
ON THIS PAGE