Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. firebase.auth().onAuthStateChanged((user) => {
  2. if (user) {
  3. firebase.database().ref('Usuarios').on('value', (snapshot) => {
  4. let state = this.state;
  5. state.list = [];
  6.  
  7. snapshot.forEach((childItem) => {
  8. state.list.push({
  9. key: childItem.key,
  10. titulo: childItem.val().titulo,
  11. nome: childItem.val().nome,
  12. });
  13. });
  14. this.setState(state);
  15. });
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement