CommandManager
import { CommandManager } from "@hyper-fetch/core"
Description
Command Manager is used to emit
command 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 builder instance.
Defined in managers/command/command.manager.ts:9
Properties
abortControllers
abortControllers
Description
Defined in managers/command/command.manager.ts:13
Type
Map<string, Map<string, AbortController>>
events
events
Description
Defined in managers/command/command.manager.ts:11
Type
{ emitAbort: (abortKey: string, requestId: string, command: CommandInstance) => void; emitDownloadProgress: (queueKey: string, requestId: string, values: FetchProgressType, details: CommandEventDetails<CommandInstance>) => void; emitLoading: (queueKey: string, requestId: string, values: CommandLoadingEventType) => void; emitRemove: <T>(queueKey: string, requestId: string, details: CommandEventDetails<T>) => void; emitRequestStart: (queueKey: string, requestId: string, details: CommandEventDetails<CommandInstance>) => void; emitResponse: (cacheKey: string, requestId: string, response: ClientResponseType<unknown, unknown>, details: CommandResponseDetails) => void; emitResponseStart: (queueKey: string, requestId: string, details: CommandEventDetails<CommandInstance>) => void; emitUploadProgress: (queueKey: string, requestId: string, values: FetchProgressType, details: CommandEventDetails<CommandInstance>) => void; onAbort: (abortKey: string, callback: (command: CommandInstance) => void) => VoidFunction; onAbortById: (requestId: string, callback: (command: CommandInstance) => void) => VoidFunction; onDownloadProgress: <T>(queueKey: string, callback: (values: FetchProgressType, details: CommandEventDetails<T>) => void) => VoidFunction; onDownloadProgressById: <T>(requestId: string, callback: (values: FetchProgressType, details: CommandEventDetails<T>) => void) => VoidFunction; onLoading: (queueKey: string, callback: (values: CommandLoadingEventType) => void) => VoidFunction; onLoadingById: (requestId: string, callback: (values: CommandLoadingEventType) => void) => VoidFunction; onRemove: <T>(queueKey: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onRemoveById: <T>(requestId: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onRequestStart: <T>(queueKey: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onRequestStartById: <T>(requestId: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onResponse: <ResponseType,ErrorType>(cacheKey: string, callback: (response: ClientResponseType<ResponseType, ErrorType>, details: CommandResponseDetails) => void) => VoidFunction; onResponseById: <ResponseType,ErrorType>(requestId: string, callback: (response: ClientResponseType<ResponseType, ErrorType>, details: CommandResponseDetails) => void) => VoidFunction; onResponseStart: <T>(queueKey: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onResponseStartById: <T>(requestId: string, callback: (details: CommandEventDetails<T>) => void) => VoidFunction; onUploadProgress: <T>(queueKey: string, callback: (values: FetchProgressType, details: CommandEventDetails<T>) => void) => VoidFunction; onUploadProgressById: <T>(requestId: string, callback: (values: FetchProgressType, details: CommandEventDetails<T>) => void) => VoidFunction }
Methods
abortAll()
abortAll()
Preview
abortAll()
Description
Defined in managers/command/command.manager.ts:59
Return
void
abortByKey()
abortByKey()
Preview
abortByKey(abortKey)
Description
Defined in managers/command/command.manager.ts:44
Parameters
Name | Details |
---|---|
abortKey
|
|
Return
void
abortByRequestId()
abortByRequestId()
Preview
abortByRequestId(abortKey, requestId)
Description
Defined in managers/command/command.manager.ts:55
Parameters
Return
void
addAbortController()
addAbortController()
Preview
addAbortController(abortKey, requestId)
Description
Defined in managers/command/command.manager.ts:15
Parameters
Return
void
getAbortController()
getAbortController()
Preview
getAbortController(abortKey, requestId)
Description
Defined in managers/command/command.manager.ts:29
Parameters
Return
AbortController