PageSourceSearch

https://react-uploady.netlify.app/assets/js/5f421e28.273dc6a6.js

js react-uploady.netlify.app collected 2026-10-03 11:23:01 UTC 9,039 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkreact_uploady_docs=self.webpackChunkreact_uploady_docs||[]).push([[8440],{56:(e,a,t)=>{t.d(a,{A:()=>s});t(6363);var r=t(3526);const n={tabItem:"tabItem_WQI_"};var l=t(7259);function s(e){let{children:a,hidden:t,className:s}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,s),hidden:t,children:a})}},4061:(e,a,t)=>{t.d(a,{A:()=>C});var r=t(6363),n=t(3526),l=t(5269),s=t(6782),o=t(7596),u=t(6853),i=t(7667),c=t(3040),d=t(820);function p(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:a}=e;return!!a&&"object"==typeof a&&"value"in a}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:a,children:t}=e;return(0,r.useMemo)((()=>{const e=a??function(e){return p(e).map((e=>{let{props:{value:a,label:t,attributes:r,default:n}}=e;return{value:a,label:t,attributes:r,default:n}}))}(t);return function(e){const a=(0,c.XI)(e,((e,a)=>e.value===a.value));if(a.length>0)throw new Error(`Docusaurus error: Duplicate values "${a.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[a,t])}function m(e){let{value:a,tabValues:t}=e;return t.some((e=>e.value===a))}function b(e){let{queryString:a=!1,groupId:t}=e;const n=(0,o.W6)(),l=function(e){let{queryString:a=!1,groupId:t}=e;if("string"==typeof a)return a;if(!1===a)return null;if(!0===a&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:a,groupId:t});return[(0,i.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const a=new URLSearchParams(n.location.search);a.set(l,e),n.replace({...n.location,search:a.toString()})}),[l,n])]}function f(e){const{defaultValue:a,queryString:t=!1,groupId:n}=e,l=h(e),[s,o]=(0,r.useState)((()=>function(e){let{defaultValue:a,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(a){if(!m({value:a,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${a}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return a}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:a,tabValues:l}))),[i,c]=b({queryString:t,groupId:n}),[p,f]=function(e){let{groupId:a}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(a),[n,l]=(0,d.Dv)(t);return[n,(0,r.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:n}),v=(()=>{const e=i??p;return m({value:e,tabValues:l})?e:null})();(0,u.A)((()=>{v&&o(v)}),[v]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),c(e),f(e)}),[c,f,l]),tabValues:l}}var v=t(1751);const g={tabList:"tabList_hEov",tabItem:"tabItem_bQse"};var x=t(7259);function y(e){let{className:a,block:t,selectedValue:r,selectValue:l,tabValues:o}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const a=e.currentTarget,t=u.indexOf(a),n=o[t].value;n!==r&&(i(a),l(n))},d=e=>{let a=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=u.indexOf(e.currentTarget)+1;a=u[t]??u[0];break}case"ArrowLeft":{const t=u.indexOf(e.currentTarget)-1;a=u[t]??u[u.length-1];break}}a?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":t},a),children:o.map((e=>{let{value:a,label:t,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===a?0:-1,"aria-selected":r===a,ref:e=>{u.push(e)},onKeyDown:d,onClick:c,...l,className:(0,n.A)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":r===a}),children:t??a},a)}))})}function k(e){let{lazy:a,children:t,selectedValue:l}=e;
1const s=(Array.isArray(t)?t:[t]).filter(Boolean);if(a){const e=s.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:s.map(((e,a)=>(0,r.cloneElement)(e,{key:a,hidden:e.props.value!==l})))})}function j(e){const a=f(e);return(0,x.jsxs)("div",{className:(0,n.A)(l.G.tabs.container,"tabs-container",g.tabList),children:[(0,x.jsx)(y,{...a,...e}),(0,x.jsx)(k,{...a,...e})]})}function C(e){const a=(0,v.A)();return(0,x.jsx)(j,{...e,children:p(e.children)},String(a))}},5488:(e,a,t)=>{t.r(a),t.d(a,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>u,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"api/hooks/useClearResumableStore","title":"useClearResumableStore","description":"Package","source":"@site/docs/api/hooks/useClearResumableStore.mdx","sourceDirName":"api/hooks","slug":"/api/hooks/useClearResumableStore","permalink":"/docs/api/hooks/useClearResumableStore","draft":false,"unlisted":false,"editUrl":"https://github.com/rpldy/react-uploady-docs/edit/master/docs/api/hooks/useClearResumableStore.mdx","tags":[{"inline":true,"label":"hook","permalink":"/docs/tags/hook"},{"inline":true,"label":"tus","permalink":"/docs/tags/tus"},{"inline":true,"label":"resumable","permalink":"/docs/tags/resumable"}],"version":"current","lastUpdatedAt":1644316370000,"frontMatter":{"id":"useClearResumableStore","title":"useClearResumableStore","pagination_label":"useClearResumableStore","sidebar_label":"\ud83e\ude9d useClearResumableStore","tags":["hook","tus","resumable"]},"sidebar":"api","previous":{"title":"useChunkStartListener","permalink":"/docs/api/hooks/useChunkStartListener"},"next":{"title":"useFileInput","permalink":"/docs/api/hooks/useFileInput"}}');var n=t(7259),l=t(9058),s=t(4061),o=t(56);const u={id:"useClearResumableStore",title:"useClearResumableStore",pagination_label:"useClearResumableStore",sidebar_label:"\ud83e\ude9d useClearResumableStore",tags:["hook","tus","resumable"]},i=void 0,c={},d=[{value:"Package",id:"package",level:2},{value:"Installation",id:"installation",level:2},{value:"Details",id:"details",level:2},{value:"Example",id:"example",level:2}];function p(e){const a={a:"a",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.h2,{id:"package",children:"Package"}),"\n",(0,n.jsx)(a.p,{children:(0,n.jsx)(a.strong,{children:(0,n.jsx)(a.em,{children:(0,n.jsx)(a.a,{href:"../../../packages/rpldy-tus-uploady",children:"@rpldy/tus-uploady"})})})}),"\n",(0,n.jsx)(a.h2,{id:"installation",children:"Installation"}),"\n",(0,n.jsxs)(s.A,{groupId:"npm2yarn",children:[(0,n.jsx)(o.A,{value:"npm",children:(0,n.jsx)(a.pre,{children:(0,n.jsx)(a.code,{className:"language-bash",children:"npm install @rpldy/tus-uploady\n"})})}),(0,n.jsx)(o.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(a.pre,{children:(0,n.jsx)(a.code,{className:"language-bash",children:"yarn add @rpldy/tus-uploady\n"})})}),(0,n.jsx)(o.A,{value:"pnpm",label:"pnpm",children:(0,n.jsx)(a.pre,{children:(0,n.jsx)(a.code,{className:"language-bash",children:"pnpm add @rpldy/tus-uploady\n"})})})]}),"\n",(0,n.jsx)(a.h2,{id:"details",children:"Details"}),"\n",(0,n.jsx)(a.pre,{children:(0,n.jsx)(a.code,{className:"language-typescript",children:"type ClearResumableStore = () => void;\n\ntype useClearResumableStore = () => ClearResumableStore;\n"})}),"\n",(0,n.jsx)(a.p,{children:"By default, the tus-sender will store the URLs for uploaded files, so it can query\nthe server for their status and skip chunks that are indicated as uploaded."}),"\n",(0,n.jsx)(a.p,{children:"The URLs are persisted to local storage. This hook allows you to clear the URLs that were previously persisted."}),"\n",(0,n.jsx)(a.h2,{id:"example",children:"Example"}),"\n",(0,n.jsx)(a.pre,{children:(0,n.jsx)(a.code,{className:"language-jsx",children:'import React from "react";\nimport { useClearResumableStore } from "@rpldy/tus-uploady";\n\nconst MyComponent = () =>
1 {\n\tconst clearResumables = useClearResumableStore();\n\n    const onClear = () => {\n      clearResumables();\n    };\n\n    return <button onClick={onClear}>Clear Store</button>;\n};\n'})})]})}function h(e={}){const{wrapper:a}={...(0,l.R)(),...e.components};return a?(0,n.jsx)(a,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},9058:(e,a,t)=>{t.d(a,{R:()=>s,x:()=>o});var r=t(6363);const n={},l=r.createContext(n);function s(e){const a=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function o(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),r.createElement(l.Provider,{value:a},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.