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

Function addAnimal

example/withSuspense/Firestore.tsx:95–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93 };
94
95 const addAnimal = () => {
96 const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra'];
97 const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)];
98 addDoc(animalsCollection, { commonName: selectedAnimal });
99 };
100
101 const removeAnimal = (id) => deleteDoc(doc(animalsCollection, id));
102

Callers 1

FavoriteAnimalsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected