Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onCollectionUpdate = (querySnapshot) => {
- const todos = [];
- querySnapshot.forEach((doc) => {
- const { title, complete } = doc.data();
- todos.push({
- key: doc.id,
- doc, // DocumentSnapshot
- title,
- complete,
- });
- });
- this.setState({
- todos,
- loading: false,
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement