Skip to main content
Version: 5.x.x

getSocketEvents


import { getSocketEvents } from "@hyper-fetch/sockets"

Description

Defined in socket/socket.events.ts:21

Preview

getSocketEvents<T>(eventEmitter)

Parameters

NameDetails

eventEmitter

Required

EventEmitter

Returns

{
emitClose: () => void;
emitConnecting: () => void;
emitEmitterEvent: (emitter: EmitterType) => void;
emitError: (event: ResponseType) => void;
emitListenerEvent: (endpoint: string, __namedParameters: [object Object]) => void;
emitListenerRemoveEvent: (endpoint: 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;
onEmitterEventByEndpoint: (emitter: EmitterType, callback: (emitter: EmitterType) => void) => VoidFunction;
onError: (callback: (event: ResponseType) => void) => VoidFunction;
onListenerEvent: (callback: (__namedParameters: [object Object]) => void) => VoidFunction;
onListenerEventByEndpoint: (listener: ListenerType, callback: (__namedParameters: [object Object]) => void) => VoidFunction;
onListenerRemove: (callback: (endpoint: string) => void) => VoidFunction;
onListenerRemoveByEndpoint: (listener: ListenerType, callback: () => void) => VoidFunction;
onOpen: (callback: () => void) => VoidFunction;
onReconnecting: (callback: (attempts: number) => void) => VoidFunction;
onReconnectingStop: (callback: (attempts: number) => void) => VoidFunction;
}