Polymer 3 and Firestore

30 views
Skip to first unread message

Vinicius Hoss

unread,
Mar 6, 2019, 10:27:04 PM3/6/19
to Polymer
Hi Everyone!

please, can someone help me with examples how to integrating Firestore and Polymer 3 (like a CRUD, using polymer 3, anything will help me so much). 

i found this codelab about polymerfire (firebase realtime database) and polymer. I did and everything works perfectly using Firebase, but i can't find anything about how to use Firestore and Polymer 3.

Sorry if this is not the appropriate group about this question.

Thank you!

Vinícius :)

Ben Sisakht

unread,
Mar 7, 2019, 2:33:46 PM3/7/19
to Polymer
Hey, Polymer 3 seems to have some issues with the way Firebase used to work with it. I managed to get it going by adding the import links into index.html (addresses either from CMD or your local node_modules for firebase_app, firebase_firestore, etc), then write the initialization code in a separate file that you then import in your my-app.js similar to how lazy-resources are imported. You can then attach an event listener that when firebase is initialized you can set a flag to true and pass that in your views if you need to know the state. Also you can add the onAuthStatechanged listener to monitor for that. Hope this helps. Cheers.
Reply all
Reply to author
Forward
0 new messages