Skip to main content
Version: v8.0.0

QueueRequest


Import
import { QueueRequest } from "@hyper-fetch/react"

Preview

type QueueRequest<Request> = ResolvedQueueItemType<Request> & { canceled?: boolean; deleteRequest: () => void; downloading: ProgressType; failed?: boolean; removed?: boolean; startRequest: () => void; stopRequest: () => void; success?: boolean; uploading: ProgressType };

Structure

QueueRequest
NameTypeDescription
request
Request
canceled
boolean

Whether the request was canceled before completing

downloading
ProgressType

Downloading progress for given request

failed
boolean

Whether the request has failed after all retry attempts

removed
boolean

Whether the request was removed from the queue

success
boolean

Whether the request completed successfully

uploading
ProgressType

Uploading progress for given request

deleteRequest
() => void

Removes request from the queue

startRequest
() => void

Callback which allow to start previously stopped request.

stopRequest
() => void

Callback which allow to stop request and cancel it if it's ongoing.