Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

v0.6.0

Choose a tag to compare

@kqito kqito released this 26 Mar 11:44
· 62 commits to main since this release

Overview

By #31

  • Remove the useTus function to save to store using cacheKey
  • Add useTusStore hooks that has to save to store functionality.
  • Remove invalid props canStoreUrls from TusClientProvider

Migrating from 0.5 to 0.6

If you use cacheKey options in useTus hooks

The useTus hooks have been removed the state management functionality using TusClientProvider and cacheKey option.

Therefore, if you are currently using useTus hooks with cacheKey option, you will need to change to use the newly added useTusStore hooks.

import { useTusStore } from 'use-tus'

// Old usage
const { upload } = useTus({ cacheKey: 'hogehoge', autoAbort: true })

// New usage
const { upload } = useTusStore('hogehoge', { autoAbort: true })

The return value of each hooks is the same, so there is no need to make any other changes

If you not use cacheKey options in useTus hooks

If you are using use-tus and not using the cacheKey option, you no longer need to specify TusClientProvider.

So please consider removing TusClientProvider from the parent comport if necessary.