import { DaffProductFacade } from '@daffodil/product/state'
A facade for getting state about a particular product.
@Injectable()
class DaffProductFacade<<T extends DaffProduct = DaffProduct>> implements DaffProductFacadeInterface<T> {
getProduct(id: T["id"]): any
getPrice(id: T["id"]): any
hasDiscount(id: T["id"]): any
getDiscountAmount(id: T["id"]): any
getDiscountedPrice(id: T["id"]): any
getDiscountPercent(id: T["id"]): any
isOutOfStock(id: T["id"]): any
dispatch(action: Action<string>): void
}
anyGet a product.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyGet the original price for a product.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyWhether a particular product has a discount.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyGet the discount amount of a product.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyGet the discounted price for a product.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyGet the discount percent of a product.
| Parameter | id: T["id"] |
|---|---|
| Description |
anyWhether a product is out of stock.
| Parameter | id: T["id"] |
|---|---|
| Description |
void| Parameter | action: Action |
|---|---|
| Description |