useSocketState
import { useSocketState } from "@hyper-fetch/react"
Description
Defined in react/src/helpers/use-socket-state/use-socket-state.hooks.ts:7
Preview
useSocketState<DataType>(socket, __namedParameters)
Parameters
Returns
readonly [UseSocketStateType<DataType>, {
setConnected: (connected: boolean) => void;
setConnecting: (connecting: boolean) => void;
setData: (data: DataType) => void;
setTimestamp: (timestamp: number) => void;
}, {
onClose: (callback: VoidFunction) => void;
onConnecting: (callback: VoidFunction) => void;
onError: (callback: (event: ErrorType) => void) => void;
onOpen: (callback: VoidFunction) => void;
onReconnecting: (callback: (attempts: number) => void) => void;
onReconnectingStop: (callback: (attempts: number) => void) => void;
}, {
setRenderKey: (renderKey: keyof UseSocketStateType<DataType>) => void;
}]