Skip to content

selectSectionValidation$(): Observable<TSectionValidation>

The selectSectionValidation$ method allows to select a validation of a section containing products and check for potential errors.

Returned value

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

Example

In this example we make a basketProductsApi call to select a validation of a section containing products and check for potential errors.

useStorefront(async (storefront) => {
    let basketProductsApi = storefront.getApiSync('basketProductsApi');

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

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

    const validation$ = this._basketProductsApi.selectSectionValidation$();
});

Basket Products API methods reference

Objects reference