Skip to main content
Version: v7.0.0

QueueRequest


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

Preview

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

Structure

QueueRequest
NameTypeDescription
request
Request
requestId
string
resolved
boolean

Resolved when we receive response

retries
number
stopped
boolean
timestamp
number
canceled
boolean
downloading
ProgressType

Downloading progress for given request

failed
boolean
removed
boolean
success
boolean
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.

React
On this page