quotes/index
@boldpenguin/sdk-redux › Globals › "quotes/index"
Index
Variables
Functions
Variables
Const getQuoteById
• getQuoteById: function & OutputSelectorFields‹function› & object = createSelector([getQuotes, (_: BpSdkStore, id: string) => id], (allQuotes, id) => allQuotes.find((q) => q.id === id), )
Get quote by ID
param The BpSdk Redux store
param Quote ID
Const getQuotesByProduct
• getQuotesByProduct: function & OutputSelectorFields‹function› & object = createSelector([getQuotes, (_: BpSdkStore, product: IProductDetail) => product], (allQuotes, product) => allQuotes.filter((q) => q.products.includes(product)), )
Get quotes by product
param The BpSdk Redux store
param IProduct
Const getQuotesByProductId
• getQuotesByProductId: function & OutputSelectorFields‹function› & object = createSelector([getQuotes, (_: BpSdkStore, productId: string) => productId], (allQuotes, productId) => { return allQuotes.filter((q) => q.products.filter((p) => p.id === productId).length); })
Get quotes by product ID
param The BpSdk Redux store
param Product ID
Const getQuotesByProductName
• getQuotesByProductName: function & OutputSelectorFields‹function› & object = createSelector( [getQuotes, (_: BpSdkStore, productName: string) => productName], (allQuotes, productName) => { return allQuotes.filter((q) => q.products.filter((p) => p.name === productName).length); }, )
Get quotes by product name
param The BpSdk Redux store
param Product name
Const getQuotesByRequestStatus
• getQuotesByRequestStatus: function & OutputSelectorFields‹function› & object = createSelector( [getQuotes, (_: BpSdkStore, status: QuoteRequestRequestTypes) => status], (allQuotes, status) => allQuotes.filter((q) => q.request_status === status), )
Get quotes by request status
param The BpSdk Redux store
param Quote status
Functions
Const getQuotes
▸ getQuotes(state: BpSdkStore): typeof QuotesState
Gets all quotes currently in the store
Parameters:
| Name | Type | Description |
|---|---|---|
state | BpSdkStore | The BpSdk Redux store |
Returns: typeof QuotesState