composeEnhancers
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/uploady
OR
npm install @rpldy/uploader
yarn add @rpldy/uploady
OR
yarn add @rpldy/uploader
pnpm add @rpldy/uploady
OR
pnpm add @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>;
};