getSocketEvents
import { getSocketEvents } from "@hyper-fetch/sockets"
Description
Defined in socket/socket.events.ts:21
Preview
getSocketEvents(eventEmitter)
Parameters
Name | Details |
---|---|
eventEmitter
|
|
Returns
{
emitClose: () => void;
emitConnecting: () => void;
emitEmitterEvent: (emitter: EmitterType) => void;
emitError: (event: ResponseType) => void;
emitListenerEvent: (name: string, data: ResponseType, event: MessageEvent<ResponseType>) => void;
emitListenerRemoveEvent: (name: string) => void;
emitOpen: () => void;
emitReconnecting: (attempts: number) => void;
emitReconnectingStop: (attempts: number) => void;
onClose: (callback: () => void) => VoidFunction;
onConnecting: (callback: () => void) => VoidFunction;
onEmitterEvent: (callback: (emitter: EmitterType) => void) => VoidFunction;
onEmitterEventByName: (emitter: EmitterType, callback: (emitter: EmitterType) => void) => VoidFunction;
onError: (callback: (event: ResponseType) => void) => VoidFunction;
onListenerEvent: (callback: (data: ResponseType, event: MessageEvent<ResponseType>) => void) => VoidFunction;
onListenerEventByName: (listener: ListenerType, callback: (data: ExtractListenerResponseType<ListenerType>, event: MessageEvent<ExtractListenerResponseType<ListenerType>>) => void) => VoidFunction;
onListenerRemove: (callback: (name: string) => void) => VoidFunction;
onListenerRemoveByName: (listener: ListenerType, callback: () => void) => VoidFunction;
onOpen: (callback: () => void) => VoidFunction;
onReconnecting: (callback: (attempts: number) => void) => VoidFunction;
onReconnectingStop: (callback: (attempts: number) => void) => VoidFunction;
}