Skip to main content

useBatchAddListener

Package​

@rpldy/uploady

Installation​

npm install @rpldy/uploady

Details​

type useBatchAddListener = BatchCancellableEventHook;
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
});

//...
};