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 11/18/2024, 3:41:36 AM
ON THIS PAGE