Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 411 Bytes

File metadata and controls

17 lines (13 loc) · 411 Bytes
title useOnChildAddedQuery

Subscribe to child_added events on a Realtime Database query.

Usage

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

const messagesRef = ref(database, "messages");
const { data: snapshot } = useOnChildAddedQuery(messagesRef, {
  queryKey: ["database", "childAdded", "messages"],
});