Reputation: 18781
I am trying to select and map the values of an observable w/o subscription?
Question:
What are the operators to select doggo[documents]
and map out blocks
w/o breaking the Observable?
from:
this.doggos.getDoggos().subscribe((doggos) => {
this.galleryItems = doggos['documents'].map(d => d.blocks);
});
to:
this.galleryItemsObs = this.doggos.getDoggos().pipe(...);
Upvotes: 1
Views: 226
Reputation: 16728
Use map
!
this.doggos.getDoggos().map((doggos) => {
return doggos['documents'].map(d => d.blocks);
});
Upvotes: 3