Skip to main content

composeEnhancers

Package​

Installation​

npm install @rpldy/uploady

OR

npm install @rpldy/uploader

Details​

Multiple enhancers can be registered by using the composeEnhancers utility method.

note

Enhancers should be written in a way they aren't dependent on the order in which they are registered

Example​

import Uploady, { composeEnhancers } from "@rpldy/uploady";
import retryEnhancer from "@rpldy/retry-hooks";

const myEnhancer = (uploader) => {

//... do something to the uploader to enhance it

return uploader;
};

const enhancer = composeEnhancers(retryEnhancer, myEnhancer);

const MyApp = () => {
return <Uploady enhancer={enhancer}>

</Uploady>;
};