Skip to main content
Version: 1.x.x

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

Description

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

Type

Map<string, Map<string, AbortController>>

emitter

Description

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

Type

EventEmitter

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()

Preview

abortAll()

Description

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

Return

void

abortByKey()

Preview

abortByKey(abortKey)

Description

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

Parameters

NameDetails

abortKey

Required

string

Return

void

abortByRequestId()

Preview

abortByRequestId(abortKey, requestId)

Description

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

Parameters

NameDetails

abortKey

Required

string

requestId

Required

string

Return

void

addAbortController()

Preview

addAbortController(abortKey, requestId)

Description

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

Parameters

NameDetails

abortKey

Required

string

requestId

Required

string

Return

void

getAbortController()

Preview

getAbortController(abortKey, requestId)

Description

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

Parameters

NameDetails

abortKey

Required

string

requestId

Required

string

Return

AbortController

removeAbortController()

Preview

removeAbortController(abortKey, requestId)

Description

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

Parameters

NameDetails

abortKey

Required

string

requestId

Required

string

Return

void

useAbortController()

Preview

useAbortController(abortKey, requestId)

Description

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

Parameters

NameDetails

abortKey

Required

string

requestId

Required

string

Return

void