Skip to content

selectSectionValidation$(): Observable<TSectionValidation>

The selectSectionValidation$ method allows to validate a section containing addresses and check for potential errors.

Returned value

A returned value has a type of Observable<TSectionValidation> where TSectionValidation represents an object that tells whether a section was successfully validated or not.

Example

In this example we make a basketAddressesApi call to validate the basket section with addresses.

useStorefront(async ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketAddressesApi = await getApi('basketAddressesApi');

        const validation = basketAddressesApi.selectSectionValidation$();
    });
});

Basket Address API methods reference

Objects reference