Interface: ProductListObservers
Observers for tracking product list data.
This group of observers provides access to the product catalog data used by the product list embed. These observers are populated when a product list embed is mounted and provide the raw data needed to display product catalogs, browse categories, and build custom product listing interfaces.
Properties
categories
categories:
Observable<ProductCategory[]>
The list of product categories.
This observable emits an array of product categories in flat structure.
Categories can be organized into a tree using the parentProductCategoryId property
on each category item.
Categories are typically used to build navigation menus and filter products by their assigned categories.
Examples
window.mimeeqApp.observers.productList.categories.subscribe(({ newValue }) => {
if (newValue) {
// Build tree structure from flat array
const tree = buildCategoryTree(newValue);
// Render category navigation
renderCategoryMenu(tree);
}
});
// Simple flat list usage
window.mimeeqApp.observers.productList.categories.subscribe(({ newValue }) => {
if (newValue) {
const select = document.getElementById('category-filter');
select.innerHTML = '<option value="">All Categories</option>';
newValue.forEach(cat => {
const option = document.createElement('option');
option.value = cat.productCategoryId;
option.textContent = cat.productCategoryName;
select.appendChild(option);
});
}
});