selectActions$(): Observable<TBasketActions>¶
The selectActions$ method allows to select a key value object with various basket actions.
Returned value¶
A returned value has a type of Observable<TBasketActions> representing an object with basket actions inside.
Example¶
In this example we make a basketOverallApi call to select whether changing a billing address is currently available.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketOverallApi = await getApi('basketOverallApi');
basketOverallApi.selectActions$().subscribe((basketActions) => {
const isBillingAddressChangeable = !!basketActions.changeBillingAddress;
if (isBillingAddressChangeable) {
// e.g. show a form for changing the billing address
}
});
});
});
Basket Overall API methods reference¶
- getActions
- getId
- selectId$
- getComment
- selectComment$
- getIsVatEu
- selectIsVatEu$
- getDelivery
- selectDelivery$
- getSum
- selectSum$
- getSumWithoutPaymentAndShipping
- selectSumWithoutPaymentAndShipping$
- cleanBasket
- setComment
- getInvalidSections
- selectInvalidSections$
- getSectionValidation
- selectSectionValidation$