eligibleCarriers/index
@boldpenguin/sdk-redux › Globals › "eligibleCarriers/index"
Index
Variables
- getEligibleCarriers
- getEligibleCarriersWithProducts
- getEligibleOfflineCarriers
- getEligibleOfflineCarriersProducts
- getEligibleOfflineCarriersWithProducts
- getEligibleOnlineCarriers
- getEligibleOnlineCarriersProducts
- getEligibleOnlineCarriersWithProducts
- getProductsForCarrier
Functions
Variables
Const
getEligibleCarriers
• getEligibleCarriers: function & OutputSelectorFields‹function› & object = createSelector( getEligibleCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]): ICarrier[] => getCarriers(carriersProducts) )
Gets all eligible carriers in the store
param
The BpSdk Redux store
Const
getEligibleCarriersWithProducts
• getEligibleCarriersWithProducts: function & OutputSelectorFields‹function› & object = createSelector( getEligibleCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]): ICarrierWithProducts[] => getCarriersWithProducts(carriersProducts) )
Gets all eligible carriers in the store with array of available products
param
The BpSdk Redux store
Const
getEligibleOfflineCarriers
• getEligibleOfflineCarriers: function & OutputSelectorFields‹function› & object = createSelector( getEligibleOfflineCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]) => getCarriers(carriersProducts) )
Gets all eligible offline carriers in the store
param
The BpSdk Redux store
Const
getEligibleOfflineCarriersProducts
• getEligibleOfflineCarriersProducts: function & OutputSelectorFields‹function› & object = createSelector( getEligibleCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]): IQuoteableCarriersProduct[] => { return carriersProducts.filter((cp) => (cp.market ? cp.market === AppetiteMarkets.OFFLINE : !cp.carrier.online)); } )
Gets offline eligible carriers products in the store
param
The BpSdk Redux store
Const
getEligibleOfflineCarriersWithProducts
• getEligibleOfflineCarriersWithProducts: function & OutputSelectorFields‹function› & object = createSelector( getEligibleOfflineCarriersProducts, (offlineCarriersProducts: IQuoteableCarriersProduct[]): ICarrierWithProducts[] => getCarriersWithProducts(offlineCarriersProducts) )
Gets all eligible offline carriers with products in the store
param
The BpSdk Redux store
Const
getEligibleOnlineCarriers
• getEligibleOnlineCarriers: function & OutputSelectorFields‹function› & object = createSelector( getEligibleOnlineCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]) => getCarriers(carriersProducts) )
Gets all eligible online carriers in the store
param
The BpSdk Redux store
Const
getEligibleOnlineCarriersProducts
• getEligibleOnlineCarriersProducts: function & OutputSelectorFields‹function› & object = createSelector( getEligibleCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]): IQuoteableCarriersProduct[] => { return carriersProducts.filter((cp) => (cp.market ? cp.market === AppetiteMarkets.BP_QUOTABLE : cp.carrier.online)); } )
Gets online eligible carriers products in the store
param
The BpSdk Redux store
Const
getEligibleOnlineCarriersWithProducts
• getEligibleOnlineCarriersWithProducts: function & OutputSelectorFields‹function› & object = createSelector( getEligibleOnlineCarriersProducts, (carriersProducts: IQuoteableCarriersProduct[]): ICarrierWithProducts[] => getCarriersWithProducts(carriersProducts) )
Gets all eligible online carriers with products in the store
param
The BpSdk Redux store
Const
getProductsForCarrier
• getProductsForCarrier: function & OutputSelectorFields‹function› & object = createSelector( [getEligibleCarriersProducts, (_: BpSdkStore, carrierId: string) => carrierId], (carriersProducts, carrierId) => { return carriersProducts.reduce( (acc: IProduct[], cp: IQuoteableCarriersProduct) => (cp.carrier.id === carrierId ? [...acc, cp.product] : acc), [] ); } )
param
The BpSdk Redux store
param
Carrier ID
Functions
Const
getEligibleCarriersProducts
▸ getEligibleCarriersProducts(state
: BpSdkStore): IQuoteableCarriersProduct[]
Gets all eligible carriers products in the store
Parameters:
Name | Type | Description |
---|---|---|
state | BpSdkStore | The BpSdk Redux store |
Returns: IQuoteableCarriersProduct[]