Svelte Query screenshot

Svelte Query

Author Avatar Theme by Sveltestack
Updated: 26 Jul 2023
841 Stars

Performant and powerful remote data synchronization for Svelte

Overview

The TanStack Query package is a versatile data fetching tool that can be used with different backend technologies and protocols. It provides features like auto caching, query parallelism, mutations, pagination, and more. It is highly customizable and can be integrated easily with Svelte projects.

Features

  • Transport/protocol/backend agnostic data fetching: Supports fetching data from various sources including REST, GraphQL, and promises.
  • Auto Caching + Refetching: Automatically caches fetched data and supports strategies like stale-while-revalidate, window refocus, and polling/realtime updates.
  • Parallel + Dependent Queries: Allows executing queries in parallel and handling dependencies between them.
  • Mutations + Reactive Query Refetching: Supports data mutations and triggers automatic refetching of related queries.
  • Multi-layer Cache + Automatic Garbage Collection: Implements a multi-layer caching system with automatic garbage collection for efficient data storage.
  • Paginated + Cursor-based Queries: Supports paginated queries and cursor-based navigation through data.
  • Load-More + Infinite Scroll Queries with Scroll Recovery: Enables seamless loading of more data and implements scroll recovery for smooth infinite scrolling experiences.
  • Request Cancellation: Provides functionality for canceling ongoing requests.

Installation

To install the TanStack Query package, use the following npm command:

npm install @tanstack/svelte-query

For detailed documentation, guides, and API references, visit the official website at tanstack.com.

Summary

The TanStack Query package is a powerful data fetching tool that offers a wide range of features for managing data in Svelte applications. Its flexible architecture allows integration with different backend technologies and protocols. With features like auto caching, query parallelism, mutations, and pagination, it provides developers with a comprehensive solution for handling data fetching in their applications. The package is well-maintained and actively welcomes contributions from the community.