useBatchRetry
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/retry-hooks
yarn add @rpldy/retry-hooks
pnpm add @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>;
};