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 ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketProductsApi = await getApi('basketProductsApi');

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

Basket Products API methods reference

Objects reference