useClearResumableStore
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/tus-uploady
yarn add @rpldy/tus-uploady
pnpm add @rpldy/tus-uploady
Detailsβ
type ClearResumableStore = () => void;
type useClearResumableStore = () => ClearResumableStore;
By default, the tus-sender will store the URLs for uploaded files, so it can query the server for their status and skip chunks that are indicated as uploaded.
The URLs are persisted to local storage. This hook allows you to clear the URLs that were previously persisted.
Exampleβ
import React from "react";
import { useClearResumableStore } from "@rpldy/tus-uploady";
const MyComponent = () => {
const clearResumables = useClearResumableStore();
const onClear = () => {
clearResumables();
};
return <button onClick={onClear}>Clear Store</button>;
};