useBatchAddListener
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/uploady
yarn add @rpldy/uploady
pnpm add @rpldy/uploady
Detailsβ
type useBatchAddListener = BatchCancellableEventHook;
- See: BatchCancellableEventHook
- See: Batch Entity
note
Event Hook - BATCH-ADD
Called when a new batch is added.
info
This event is cancellable
The handler passed to the hook may return an async result (promise).
Exampleβ
import { useBatchAddListener } from "@rpldy/uploady";
const MyComponent = () => {
useBatchAddListener((batch, options) => {
console.log(`batch ${batch.id} was just added with ${batch.items.length} items`);
//return false to cancel the batch
});
//...
};