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
abortControllers
Description
Defined in managers/request/request.manager.ts:13
Type
Map<string, Map<string, AbortController>>
events
events
Description
Defined in managers/request/request.manager.ts:11
Type
{ 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: <AdapterType>(cacheKey: string, requestId: string, response: ResponseReturnType<unknown, unknown, AdapterType>, 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,AdapterType>(cacheKey: string, callback: (response: ResponseReturnType<Response, ErrorType, AdapterType>, details: ResponseDetailsType) => void) => VoidFunction; onResponseById: <Response,ErrorType,AdapterType>(requestId: string, callback: (response: ResponseReturnType<Response, ErrorType, AdapterType>, 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()
abortAll()
Preview
abortAll()
Description
Defined in managers/request/request.manager.ts:59
Return
void
abortByKey()
abortByKey()
Preview
abortByKey(abortKey)
Description
Defined in managers/request/request.manager.ts:44
Parameters
Name | Details |
---|---|
abortKey
|
|
Return
void
abortByRequestId()
abortByRequestId()
Preview
abortByRequestId(abortKey, requestId)
Description
Defined in managers/request/request.manager.ts:55
Parameters
Return
void
addAbortController()
addAbortController()
Preview
addAbortController(abortKey, requestId)
Description
Defined in managers/request/request.manager.ts:15
Parameters
Return
void
getAbortController()
getAbortController()
Preview
getAbortController(abortKey, requestId)
Description
Defined in managers/request/request.manager.ts:29
Parameters
Return
AbortController