Skip to content

invertase/tanstack-query-firebase

This branch is 59 commits behind main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dcf569d · Dec 23, 2024
Dec 22, 2024
May 26, 2022
Dec 17, 2024
Dec 18, 2024
Dec 23, 2024
Dec 17, 2024
Sep 26, 2024
Dec 21, 2024
Dec 6, 2024
Dec 15, 2024
Nov 25, 2024
Sep 13, 2021
Dec 23, 2024
Dec 23, 2024
Nov 25, 2024
Jun 20, 2022
Dec 17, 2024
Dec 21, 2024
Dec 17, 2024
Dec 16, 2024

Repository files navigation

Important

This project is currently a work in progress. Please check back soon for updates!

TanStack Query Firebase

A set of TanStack Query hooks integrating with Firebase.

Installation DocumentationLicense


TanStack Query Firebase provides a set of hooks for handling asynchronous tasks with Firebase in your applications.

Looking for React Query Firebase? Check out the old branch.

Why use this library?

When managing Firebase’s asynchronous API calls within your application, state synchronization can become cumbersome in most applications. You will commonly find yourself handling loading states, error states, and data synchronization manually.

This library provides a hands-off approach to these problems, by leveraging the popular TanStack Query project. Out of the box, you get:

  • Automatic Caching: Avoid redundant Firebase calls with built-in caching.
  • Out-of-the-box Synchronization: TanStack Query keeps your UI in sync with the Firebase backend effortlessly.
  • Background Updates: Fetch and sync data seamlessly in the background without interrupting the user experience.
  • Error Handling & Retries: Get automatic retries on failed Firebase calls, with robust error handling baked in.
  • Dev Tools for Debugging: Leverage the React Query Devtools to gain insights into your data-fetching logic and Firebase interactions.

By combining Firebase with TanStack Query, you can make your app more resilient, performant, and scalable, all while writing less code.

Installation

This project expects you have firebase installed as a peer dependency. If you haven't done so already, install firebase:

npm i --save firebase

Next, install specific packages for your framework of choice:

React

npm i --save @tanstack/react-query @tanstack-query-firebase/react

See the Documentation for more information on how to use the library.

Status

The status of the following Firebase services and frameworks are as follows:

  • ✅ Ready for use
  • 🟠 Work in progress
  • () Not yet started

| Module | React | Vue | Solid | Angular | Svelte | |----------------|--:-:--|--:-:--|--:-:--|--:-:----|--:-:---| | analytics | | | | | | | app-check | | | | | | | auth | 🟠 | | | | | | database | | | | | | | data-connect | ✅ | | | | | | firestore | 🟠 | | | | | | firestore/lite | | | | | | | functions | | | | | | | installations | | | | | | | messaging | | | | | | | performance | | | | | | | remote-config | | | | | | | vertexai | | | | | |

License


Built and maintained by Invertase.