Skip to main content
Version: 4.x.x

getRequestManagerEvents


import { getRequestManagerEvents } from "@hyper-fetch/core"

Description

Defined in managers/request/request.manager.events.ts:27

Preview

getRequestManagerEvents(emitter)

Parameters

NameDetails

emitter

Required

EventEmitter

Returns

{
emitAbort: (abortKey: string, requestId: string, request: RequestInstance) => void;
emitDownloadProgress: (queueKey: string, requestId: string, values: ProgressType, details: RequestEventType<RequestInstance>) => void;
emitLoading: (queueKey: string, requestId: string, values: RequestLoadingEventType) => void;
emitRemove: (queueKey: string, requestId: string, details: RequestEventType<T>) => void;
emitRequestStart: (queueKey: string, requestId: string, details: RequestEventType<RequestInstance>) => void;
emitResponse: (cacheKey: string, requestId: string, response: ResponseReturnType<unknown, unknown, Adapter>, details: ResponseDetailsType) => void;
emitResponseStart: (queueKey: string, requestId: string, details: RequestEventType<RequestInstance>) => void;
emitUploadProgress: (queueKey: string, requestId: string, values: ProgressType, details: RequestEventType<RequestInstance>) => void;
onAbort: (abortKey: string, callback: (request: RequestInstance) => void) => VoidFunction;
onAbortById: (requestId: string, callback: (request: RequestInstance) => void) => VoidFunction;
onDownloadProgress: (queueKey: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction;
onDownloadProgressById: (requestId: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction;
onLoading: (queueKey: string, callback: (values: RequestLoadingEventType) => void) => VoidFunction;
onLoadingById: (requestId: string, callback: (values: RequestLoadingEventType) => void) => VoidFunction;
onRemove: (queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onRemoveById: (requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onRequestStart: (queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onRequestStartById: (requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onResponse: (cacheKey: string, callback: (response: ResponseReturnType<Response, ErrorType, Adapter>, details: ResponseDetailsType) => void) => VoidFunction;
onResponseById: (requestId: string, callback: (response: ResponseReturnType<Response, ErrorType, Adapter>, details: ResponseDetailsType) => void) => VoidFunction;
onResponseStart: (queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onResponseStartById: (requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction;
onUploadProgress: (queueKey: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction;
onUploadProgressById: (requestId: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction;
}