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 (storefront) => {
    let basketAddressesApi = storefront.getApiSync('basketAddressesApi');

    if (!basketAddressesApi) {
        const featureSystemApi = this.getApiSync('FeatureSystemApi');
        await featureSystemApi.registerDynamic('basket');

        basketAddressesApi = storefront.getApiSync('basketAddressesApi');
    }

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

Basket Address API methods reference

Objects reference