import { DaffCategoryFacadeInterface } from '@daffodil/category/state'
A facade for interacting with the category state. This facade exposes many parts of the state for easy access and allows dispatching of actions.
interface DaffCategoryFacadeInterface<V extends DaffGenericCategory<V> = DaffCategory, W extends DaffProduct = DaffProduct> {
category$: Observable<V>
products$: Observable<W[]>
isCategoryEmpty$: Observable<boolean>
getCategoryById(id: V["id"]): Observable<V>
getProductsByCategory(categoryId: V["id"]): Observable<W[]>
getTotalProductsByCategory(categoryId: V["id"]): Observable<number>
}
category$ Observable<V> |
---|
The currently selected category. |
products$ Observable<W[]> |
---|
Products of the current category. |
isCategoryEmpty$ Observable<boolean> |
---|
Is the category page empty of products. |
Observable<V>
Get a category by the provided Id.
Parameter | id: V["id"] |
---|---|
Description |
Observable<W[]>
Get products by a category Id.
Parameter | categoryId: V["id"] |
---|---|
Description |
Observable<number>
Get products by a category Id.
Parameter | categoryId: V["id"] |
---|---|
Description |