Skip to main content

CommandManager

Class


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.

Import

import { CommandManager } from "@better-typed/hyper-fetch"

Methods

useAbortController()

useAbortController(abortKey, requestId)
Returns a void

Parameters

Name Type Default Value Description
abortKey string - -
requestId string - -

removeAbortController()

removeAbortController(abortKey, requestId)
Returns a void

Parameters

Name Type Default Value Description
abortKey string - -
requestId string - -

getAbortController()

getAbortController(abortKey, requestId)
Returns a AbortController

Parameters

Name Type Default Value Description
abortKey string - -
requestId string - -

addAbortController()

addAbortController(abortKey, requestId)
Returns a void

Parameters

Name Type Default Value Description
abortKey string - -
requestId string - -

abortByRequestId()

abortByRequestId(abortKey, requestId)
Returns a void

Parameters

Name Type Default Value Description
abortKey string - -
requestId string - -

abortByKey()

abortByKey(abortKey)
Returns a void

Parameters

Name Type Default Value Description
abortKey string - -

abortAll()

abortAll()
Returns a void