Skip to content

selectSectionValidation$(): Observable<TSectionValidation>

The selectSectionValidation$ method allows to select a validation for the basket summary section.

Returned value

A returned value has a type of Observable<TSectionValidation> where TSectionValidation represents the TSectionValidation object.

Example

In this example we make a basketOverallApi call to select a validation for the basket summary section.

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

        const sectionValidation$ = basketOverallApi.selectSectionValidation$();

        sectionValidation$.subscribe((sectionValidation) => {
            if (!sectionValidation.isValid) {
                console.log('summary section validation message:', sectionValidation.validationMessage);
            }
        });
    });
});

Basket Overall API methods reference

Objects reference