feat: filter to ephemeral streams and particles

This commit is contained in:
talksik
2026-03-21 18:55:03 -07:00
parent 356a166c7e
commit 97b2e7914e
5 changed files with 41 additions and 3 deletions
+4
View File
@@ -12,6 +12,7 @@ import {
toFirestoreChildrenPath,
} from "@/lib/particle-path";
import { useQuery } from "@tanstack/react-query";
import { QueryFieldFilterConstraint } from "firebase/firestore";
interface UseLiveParticleResult {
particle: Particle | null;
@@ -62,6 +63,7 @@ export function useLiveParticleChildren(
visibilityScopes?: string[],
onAdded?: (child: Particle) => void,
onRemoved?: (child: Particle, updatedChildren: Particle[]) => void,
whereFilter?: QueryFieldFilterConstraint
): UseLiveParticleChildrenResult {
const [children, setChildren] = useState<Particle[]>([]);
const [isLoading, setIsLoading] = useState(true);
@@ -89,9 +91,11 @@ export function useLiveParticleChildren(
orderDirection,
onAdded,
onRemoved,
whereFilter,
);
return unsubscribe;
// FIX: do we need to listen to more deps? Would that cause side effects that break behavior
}, [collectionPath]);
return { children, isLoading, error };