MCPcopy Create free account
hub / github.com/FirebaseExtended/reactfire / addAnimal

Function addAnimal

example/withoutSuspense/Firestore.tsx:44–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 });
43
44 const addAnimal = () => {
45 const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra'];
46 const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)];
47 addDoc(animalsCollection, { commonName: selectedAnimal });
48 };
49
50 if (status === 'loading') {
51 return <LoadingSpinner />;

Callers 1

AnimalsListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected