select$(): Observable<ProductBasket[]>¶
The select$
method allows to select a list of items inside the basket.
Returned value¶
A returned value has a type of Observable<ProductBasket[]> representing a list of products inside the basket.
Example¶
In this example we make a basketProductsApi
call to select a list of items inside the basket.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketProductsApi = await getApi('basketProductsApi');
const productsInBasket$ = basketProductsApi.select$();
});
});
Basket Products API methods reference¶
- get
- remove
- update
- getBasketCount
- selectBasketCount$
- getBasketPositions
- selectBasketPositions$
- getSum
- selectSum$
- getDiscountedSum
- selectDiscountedSum$
- getSectionValidation
- selectSectionValidation$