MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / addAnimal

Function addAnimal

example/withoutSuspense/RealtimeDatabase.tsx:41–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 });
40
41 const addAnimal = () => {
42 const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra'];
43 const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)];
44 const newRef = push(animalsRef);
45 set(newRef, { commonName: selectedAnimal });
46 };
47
48 if (status === 'loading') {
49 return <LoadingSpinner />;

Callers 1

AnimalsListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected