Skip to main content

useClearResumableStore

Package​

@rpldy/tus-uploady

Installation​

npm install @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>;
};