In this effect I’m getting product and if this product has “childProducts” it becomes array of products.
Then, on the map function there is a pop up modal for each of the products in the array.
I want to make some action when the map is finished with all products.
How it be achieved?
@Effect()
selectProductPage$ = this.actions$.ofType<SelectProduct>(OrderActionTypes.SelectProduct).pipe(
map(action => action.payload),
switchMap((product) => {
const allTests = [product, ...(product.product.childProducts || [])].map(cloneDeep);
return from(allProducts);
}),
map((product: any) => {
// pop up modal for each product
})
);