#Firebase timing

6 messages · Page 1 of 1 (latest)

kind gyro
#

Hey i have problem with delay from firebase and responding/loading data. Data loads like 3-4seconds but this colection will have the same amount of data all time - like 20 items to load.

firestorePlacesCollection = this.firestore.collection('items'); //, ref=>ref.where("serverName","==", )

  //READ
  items$ = this.firestorePlacesCollection.snapshotChanges().pipe(
    map((actions) => {
      console.log(actions);
      return actions.map((p) => {
        const item = p.payload.doc;
        const id = item.id;
        const data = item.data();
        return { id, ...(data as {}) } as ShopItem;
      });
    })
  );
teal pebble
#

firestorePlacesCollection = this.firestore.collection('items', ref => ref.limit(20));

#

You can limit items like this way.

kind gyro
#

yea but if i know that there are 20 items (cuz its static data that admin can change by panel)

#

and this loads 3s xd

teal pebble
#

umm, so do you want to reduce the loading time?