Skip to content

Commit

Permalink
work little bit on data
Browse files Browse the repository at this point in the history
  • Loading branch information
arikamat committed Apr 1, 2023
1 parent 58d791a commit c919f58
Show file tree
Hide file tree
Showing 3 changed files with 7,510 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ web-build/
firebase.js
# macOS
.DS_Store

.env
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
8 changes: 8 additions & 0 deletions util/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { firestore } from './firebase';

const fetchFirestoreData = async (collectionName) => {
const collectionRef = firestore.collection(collectionName);
const snapshot = await collectionRef.get();
const data = snapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() }));
return data;
}
Loading

0 comments on commit c919f58

Please sign in to comment.