Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 386 Bytes

File metadata and controls

17 lines (13 loc) · 386 Bytes
title useOnValueQuery

Subscribe to value events at a Realtime Database location.

Usage

import { ref } from "firebase/database";
import { useOnValueQuery } from "@tanstack-query-firebase/react/database";

const userRef = ref(database, `users/${uid}`);
const { data: snapshot } = useOnValueQuery(userRef, {
  queryKey: ["database", "onValue", "users", uid],
});