B
Size: a a a
B
GK
Эи
Observable<Array<CategoryListModel>>
B
S
this.getOrders().pipe(
switchMap(orders =>
forkJoin(orders.map(order => this.getCourier(order.courierId).pipe(
map(courier => ({ order, courier })),
)))
),
)
this.getOrders().pipe(
switchMap(orders => this.getCouriers(orders.map(order => order.courierId)).pipe(
map(couriers => {
const couriersById = new Map(couriers.map(courier => [ courier.id, courier ]));
return orders.map(order => ({ order, courier: couriersById.get(order.courierId) }))
}),
)),
)
S
S
ВС
this.getOrders().pipe(
switchMap(orders => this.getCouriers(orders.map(order => order.courierId)).pipe(
map(couriers => {
const couriersById = new Map(couriers.map(courier => [ courier.id, courier ]));
return orders.map(order => ({ order, courier: couriersById.get(order.courierId) }))
}),
)),
)
ВС
B
DB
fetchPolicy: 'cache-and-network'
?)J💖
J💖
B
B
B
B
АА