Releases: kqito/use-tus
Releases · kqito/use-tus
v0.3.0
Overview
- Update
defaultOptions
props ofTusClientProvider
to function. (#28) - Add some examples to README.md
About defaultOptions
props of TusClientProvider
Previously, the type of defaultOptions
props is just object.
But It allowed you to intuitively specify default options, but it did not allow you to specify the default options associated with the you want to upload.
For this reason, I changed defaultOptions
to allow to be specified as follows.
const defaultOptions: DefaultOptions = (contents) => {
const file = contents instanceof File ? contents : undefined;
return {
endpoint: 'https://example.com',
metadata: file
? {
filename: file.name,
filetype: file.type,
}
: undefined,
};
};
export const App = () => (
<TusClientProvider defaultOptions={defaultOptions}>
<Uploader />
</TusClientProvider>
);
If you think this library looks good, please star it!
v0.2.4
v0.2.0
Overview
- Add
useTusOptions
(PR: #18) - Add
autoAbort
option - Change
cacheKey
to as a part ofuseTusOptions
Add useTusOptions
that is argument of useTus
hooks
Moved the cacheKey argument to options, as I plan to add various options to useTus in the future.
before
const { upload } = useTus(cacheKey)
after
const { upload } = useTus({ cacheKey })
Add autoAbort
option to useTus
In the past, useTus would continue to upload in the background even if you switched cacheKeys or unmounted during the upload.
The default value for this option is true
const { upload } = useTus({ cacheKey, autoAbort })
If you think this library looks good, please star it!
v0.1.0
Overview
- First release v0.1.0 🎉
API
- Add
useTus
(detail: https://github.com/kqito/use-tus#usetus-hooks) - Add
TusClientProvider
(detail: https://github.com/kqito/use-tus#tusclientprovider)
If you think this library looks good, please star it!