Skip to main content
Version: 5.x.x

RequestManager


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

Descriptionโ€‹

Request Manager is used to emit request lifecycle events like - request start, request end, upload and download progress. It is also the place of request aborting system, here we store all the keys and controllers that are isolated for each client instance.

Defined in managers/request/request.manager.ts:9

Propertiesโ€‹

abortControllersโ€‹

Descriptionโ€‹

Defined in managers/request/request.manager.ts:13

Map<string, Map<string, AbortController>>

emitterโ€‹

Descriptionโ€‹

Defined in managers/request/request.manager.ts:10

EventEmitter

eventsโ€‹

Descriptionโ€‹

Defined in managers/request/request.manager.ts:11

{ 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: <T>(queueKey: string, requestId: string, details: RequestEventType<T>) => void; emitRequestStart: (queueKey: string, requestId: string, details: RequestEventType<RequestInstance>) => void; emitResponse: <Adapter>(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: <T>(queueKey: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction; onDownloadProgressById: <T>(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: <T>(queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onRemoveById: <T>(requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onRequestStart: <T>(queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onRequestStartById: <T>(requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onResponse: <Response,ErrorType,Adapter>(cacheKey: string, callback: (response: ResponseReturnType<Response, ErrorType, Adapter>, details: ResponseDetailsType) => void) => VoidFunction; onResponseById: <Response,ErrorType,Adapter>(requestId: string, callback: (response: ResponseReturnType<Response, ErrorType, Adapter>, details: ResponseDetailsType) => void) => VoidFunction; onResponseStart: <T>(queueKey: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onResponseStartById: <T>(requestId: string, callback: (details: RequestEventType<T>) => void) => VoidFunction; onUploadProgress: <T>(queueKey: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction; onUploadProgressById: <T>(requestId: string, callback: (values: ProgressType, details: RequestEventType<T>) => void) => VoidFunction }

Methodsโ€‹

abortAll()โ€‹

Previewโ€‹

abortAll()

Descriptionโ€‹

Defined in managers/request/request.manager.ts:59

Returnโ€‹

void

abortByKey()โ€‹

Previewโ€‹

abortByKey(abortKey)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:44

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

Returnโ€‹

void

abortByRequestId()โ€‹

Previewโ€‹

abortByRequestId(abortKey, requestId)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:55

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

requestIdโ€‹

Required

string

Returnโ€‹

void

addAbortController()โ€‹

Previewโ€‹

addAbortController(abortKey, requestId)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:15

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

requestIdโ€‹

Required

string

Returnโ€‹

void

getAbortController()โ€‹

Previewโ€‹

getAbortController(abortKey, requestId)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:29

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

requestIdโ€‹

Required

string

Returnโ€‹

AbortController

removeAbortController()โ€‹

Previewโ€‹

removeAbortController(abortKey, requestId)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:33

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

requestIdโ€‹

Required

string

Returnโ€‹

void

useAbortController()โ€‹

Previewโ€‹

useAbortController(abortKey, requestId)

Descriptionโ€‹

Defined in managers/request/request.manager.ts:39

Parametersโ€‹

NameDetails

abortKeyโ€‹

Required

string

requestIdโ€‹

Required

string

Returnโ€‹

void