Skip to content

Releases: kqito/use-tus

v0.3.0

04 Aug 13:46
Compare
Choose a tag to compare

Overview

  • Update defaultOptions props of TusClientProvider 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

26 Jun 10:00
Compare
Choose a tag to compare

Overview

  • Add isAborted property to return value of useTus (#24)

About isAborted

isAborted is the return value of the new useTus that indicates whether the upload was aborted or not.

If you think this library looks good, please star it!

v0.2.0

22 May 18:35
Compare
Choose a tag to compare

Overview

  • Add useTusOptions (PR: #18)
  • Add autoAbort option
  • Change cacheKey to as a part of useTusOptions

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

18 Apr 15:01
Compare
Choose a tag to compare

Overview

  • First release v0.1.0 🎉

API

If you think this library looks good, please star it!