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 8/5/2024, 7:53:31 PM
ON THIS PAGE