readProductFromServer() {
this.qS = this.afDatabase.list('product_table', ref => {
return ref.limitToLast(1000) ;
}).snapshotChanges().map(changes => {
return changes.map(c => ({ key1: c.payload.key, ...c.payload.val() }));
});
this.qS.take(1).subscribe(values => {
});
}
Is there a way to ensure that this code only reads from the server once? I've looked online for solutions, but couldn't find any that match my specific code.