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

Function addAnimal

example/withSuspense/RealtimeDatabase.tsx:38–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 });
37
38 const addAnimal = () => {
39 const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra'];
40 const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)];
41 const newRef = push(animalsRef);
42 set(newRef, { commonName: selectedAnimal });
43 };
44
45 if (!animals) {
46 return <span>no animals found</span>;

Callers 1

AnimalsListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected