useChunkStartListener
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/chunked-uploady
yarn add @rpldy/chunked-uploady
pnpm add @rpldy/chunked-uploady
Detailsβ
type StartEventResponse = void | boolean | {
url?: string,
sendOptions?: SendOptions
};
type useChunkStartListener = (cb: (data: ChunkStartEventData ) => StartEventResponse) => void;
- See: ChunkStartEventData
- See: SendOptions
note
Event Hook - CHUNK_START
Called when a chunk begins uploading as part of a chunked upload
info
This event is cancellable
Exampleβ
import { useChunkStartListener } from "@rpldy/chunked-uploady";
const MyComponent = () => {
useChunkStartListener((data) => {
return {
url: `${data.url}/${data.chunk.index}`
};
});
};