DaffProductEntitiesMemoizedSelectors
An interface for selectors related to product entities and prices for simple products.
import { DaffProductEntitiesMemoizedSelectors } from '@daffodil/product/state'
interface DaffProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {
selectProductEntitiesState: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>>
selectProductIds: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['ids']>
selectProductEntities: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['entities']>
selectAllProducts: MemoizedSelector<DaffProductStateRootSlice<T>, T[]>
selectProductTotal: MemoizedSelector<DaffProductStateRootSlice<T>, number>
selectProduct: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, T>
selectProductPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>
selectProductDiscountAmount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>
selectProductDiscountedPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>
selectProductDiscountPercent: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>
selectProductHasDiscount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>
selectIsProductOutOfStock: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>
}
Properties
Name | Type | Description |
---|---|---|
selectProductEntitiesState | MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>> | Selects the ngrx entities state for products. |
selectProductIds | MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['ids']> | Selects all ids for products in state. |
selectProductEntities | MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['entities']> | Selects the ngrx entities for all products in state. |
selectAllProducts | MemoizedSelector<DaffProductStateRootSlice<T>, T[]> | Selects all products in state as an array. |
selectProductTotal | MemoizedSelector<DaffProductStateRootSlice<T>, number> | Selects the total number of products in state. |
selectProduct | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, T> | Selects a product by id. |
selectProductPrice | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number> | Selects the price of a product. |
selectProductDiscountAmount | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number> | Selects the discount of a product as some amount of currency. |
selectProductDiscountedPrice | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number> | Selects the discounted price of a product. |
selectProductDiscountPercent | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number> | Selects the discount of a product as a percent of the original price. |
selectProductHasDiscount | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean> | Selects whether or not the product has a discount. |
selectIsProductOutOfStock | (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean> | Selects whether or not a product is out of stock. |