Skip to content

Update README.md to document TanStack migration #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ Hooks for managing, caching and syncing asynchronous and remote data in Svelte
# This package has been migrated to the [TanStack Query](https://github.com/TanStack/query/tree/main/packages/svelte-query) repo.
You can install it with npm install `@tanstack/svelte-query`

## Upgrading to TanStack

It's easy to migrate your existing application over to tanstack from this package ✨

```bash
npm uninstall @sveltestack/svelte-query
npm install @tanstack/svelte-query
```

Replace the following import:
`@sveltestack/svelte-query` -> `@tanstack/svelte-query`

Rename the following functions:

`useQuery` -> `createQuery`

`useQueries` -> `createQueries`

`useMutation` -> `createMutation`

Finally, as of v4, queryKey needs to be an Array:

If you are using a string like `repoData`, please change it to an Array, e.g. `['repoData']`

## Visit [tanstack.com](https://tanstack.com/query/latest/docs/svelte/overview) for docs, guides, API and more!

## Quick Features
Expand Down