Closed MrPhishfood closed 7 years ago
As far as I remember, there's no impact because once you have downloaded the data using firebase, it stays in the browser. That means even if you put the same reference in another element, it just gets the data from the browser's memory and not get it from firebase.
You can actually check in the websockets that it just fetch the data that is needed to populate the path tree that you want to query. Even if you have several lists, as long as those lists reference the same path, it will only load once
Thanks for the quick reply, I'm still a newbie at this stuff, I'll check out how to do the websockets thing.
First Example
So in my app I have a list of products (at most 150) in firebase, and each item in the list includes all the subproperties that describes that item, like so:
So I have a firebase-query for
product-list
and I iterate through the list:But what I do is only pass on the key, and in
product-element
I use a firebase-document to get data for that product, like so:So is there a particularly big performance penalty for me doing things this way or does
polymerfire
intelligently workout that I'm referencing data I already have and doesn't fetch any new data?Second Example
In my app I have a couple of pages
In pages 1, 2 and 3 I need some data that I can get from:
...and I create that element inside of those pages. Is there any performance hit to this or it is best to just create the firebase element in
my-app-element
and pass it down to the pages?