Methods
details(productIdnon-null) → {ManagedDetailsQuery}
Get details of a product
Parameters:
Name | Type | Description |
---|---|---|
productId |
string | IPC PID of product |
Returns:
- Type
- ManagedDetailsQuery
Examples
// returns a ManagedDetailsQuery instance
const detailsQuery = queryManager.details(42)
const detailsSub = detailsQuery.out.subscribe((x) => {
console.log("product details", x);
// update UI
});
detailsQuery.next();
// when the user navigates to a different page or the component is unmounted
detailsSub.unsubscribe();
detailsQuery.destroy();
filters(categoryIdnon-null) → {ManagedFiltersQuery}
Get filter attributes and values for a category
Parameters:
Name | Type | Description |
---|---|---|
categoryId |
string | CT UUID of category |
Returns:
- Type
- ManagedFiltersQuery
Examples
// returns a ManagedFiltersQuery instance
const filtersQuery = queryManager.filters('c6361e28-370e-4ac0-a720-e64c0a214e07')
const filtersSub = filtersQuery.out.subscribe((x) => {
console.log("category filters", x);
// update UI
});
filtersQuery.next();
// when the user navigates to a different page or the component is unmounted
filtersSub.unsubscribe();
filtersQuery.destroy();
products(categoryIdnon-null) → {ManagedProductsQuery}
Get products matching filters for a category
Parameters:
Name | Type | Description |
---|---|---|
categoryId |
string | CT UUID of category |
Returns:
- Type
- ManagedProductsQuery
Examples
// returns a ManagedProductsQuery instance
const productsQuery = queryManager.products('c6361e28-370e-4ac0-a720-e64c0a214e07')
const productsSub = productsQuery.products.subscribe((x) => {
console.log("products matching filters", x);
// update UI
});
const totalsSub = productsQuery.totals.subscribe((x) => {
console.log("total count of products matching filters", x);
// update UI
});
productsQuery.next({
pagination: {
offset: 0,
limit: 20,
},
filters: [
{ attributeId: 11, values: [71, 72] }
],
sort: 0
});
// when the user navigates to a different page or the component is unmounted
productsSub.unsubscribe();
totalsSub.unsubscribe();
productsQuery.destroy();
search() → {ManagedSearchQuery}
Search for categories, brands, and products
Returns:
- Type
- ManagedSearchQuery
Examples
// returns a ManagedSearchQuery instance
const searchQuery = queryManager.search()
const searchSub = searchQuery.out.subscribe((x) => {
console.log("search results", x);
// update UI
});
searchQuery.next('blue jeans');
// when the user navigates to a different page or the component is unmounted
searchSub.unsubscribe();
searchQuery.destroy();
// keep calling next() as the user types
searchQuery.next('b');
searchQuery.next('bl');
searchQuery.next('blu');
searchQuery.next('blue');