Home > widget-integration > BEHAVIOR_TYPE

BEHAVIOR_TYPE variable

Pagination behavior types for filter API requests.

Defines how new results should be integrated with existing content when paginating.

Signature:

BEHAVIOR_TYPE: {
	readonly MORE: "more";
	readonly PREVIOUS: "previous";
	readonly REPLACE: "replace";
}

Remarks

Used in FilterAPIAdditionParams to control result loading behavior. - MORE: Appends results for infinite scroll (most common) - PREVIOUS: Prepends results for bidirectional scroll - REPLACE: Replaces all results for traditional pagination

Example

Implement custom infinite scroll behavior:

window.boostWidgetIntegration.extend('FilterHandler', (FilterHandler) => {
  return class extends FilterHandler {
    async loadMoreProducts() {
      const additions = {
        behavior: BEHAVIOR_TYPE.MORE,
        page: this.getCurrentPage() + 1
      };
      return this.filterAPI.getProductByFilter(this.currentParams, additions);
    }
  };
});