Newbie question:
I am trying to export my data from a rest API to firebase.
I am using Angular6 with RxJS 6.
getByTag(tag:string) {
return this.http.get(this.URL + '/get/listings/', { headers })
.pipe(
map((res: Listings) => res.items),
// How do I add an additional property to each of these items? eg res.items.inserted = new Date();
// How do chain each of these res.items to another function called exportToFirebase(res.item))
);
}
My Data looks something like this: https://pasteboard.co/HWp1hUb.jpg
I tried the map function but my incoming data stream from the API is an array of arrays so I attempted mergeMap without any success (https://www.learnrxjs.io/operators/transformation/mergemap.html)
I attempted a do() statement to trigger the exportToFirebase(res.item), but It looks like I am completely off track here :-P
Expected result: Create a loop to send item parameter of type Listing to my service function called exportToFirebase(res.item)
Questions?
How do I add an additional property to each of these items? eg
res.items.inserted = new Date();?How do chain each of these
res.itemsto another function calledexportToFirebase(res.item))?
exportToFirebase(res.item)returns an Observable? - martin