Skip to main content
Version: 4.x.x

useQueue


import { useQueue } from "@hyper-fetch/react"

Description

Defined in react/src/hooks/use-queue/use-queue.hooks.ts:14

Preview

useQueue<Request>(request, options)

Parameters

NameDetails

request

Required

Request

options

Required

UseQueueOptionsType

Returns

{
pause: () => void;
requests: {
request: Request;
requestId: string;
retries: number;
stopped: boolean;
timestamp: number;
deleteRequest: () => void;
downloading: {
loaded: number;
progress: number;
sizeLeft: number;
startTimestamp: number;
timeLeft: number | null;
total: number;
};
startRequest: () => void;
stopRequest: () => void;
uploading: {
loaded: number;
progress: number;
sizeLeft: number;
startTimestamp: number;
timeLeft: number | null;
total: number;
};
}[];
start: () => void;
stop: () => void;
stopped: boolean;
}