GitHub

DaffCompositeProductAppliedOptionsEntitiesAdapter

import { DaffCompositeProductAppliedOptionsEntitiesAdapter } from '@daffodil/product-composite/state'

Composite Product Item Options Adapter for changing/overwriting entity state.

class DaffCompositeProductAppliedOptionsEntitiesAdapter<<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>>>  {
  getInitialState(): EntityState<DaffCompositeProductEntity>
  getSelectors(): EntitySelectors<DaffCompositeProductEntity, EntityState<DaffCompositeProductEntity>>
  upsertProducts(
    state: T
    ...products: DaffCompositeProduct[]
  ): T
  applyOption(
    state: T
    productId: string
    itemId: string
    optionId: string
    qty?: number
  ): T
}