Skip to main content

useChunkStartListener

Package​

@rpldy/chunked-uploady

Installation​

npm install @rpldy/chunked-uploady

Details​


type StartEventResponse = void | boolean | {
url?: string,
sendOptions?: SendOptions
};

type useChunkStartListener = (cb: (data: ChunkStartEventData ) => StartEventResponse) => void;
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}`
};
});
};