Skip to main content

useBatchRetry

Package​

@rpldy/retry-hooks

Installation​

npm install @rpldy/retry-hooks

Details​

type RetryBatchMethod = (batchId?: string) => boolean;

type useBatchRetry = () => RetryBatchMethod;

Returns a retry function.

When called, passing a batch id, will attempt retry for all failed items in that batch.

info

To enable retries for your Uploady instance, you need to use the provided (uploader enhancer): retryEnhancer.

Example​

import React from "react";
import { useBatchRetry } from "@rpldy/retry-hooks";

const MyComponent = ( ) => {
const retryBatch = useBatchRetry();

const onClick = () => {
retryBatch("b-123");
};

return <button onClick={onClick}>retry batch</button>;
};