GitHub

DaffCompositeProductAppliedOptionsEntitiesAdapter

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

import { DaffCompositeProductAppliedOptionsEntitiesAdapter } from '@daffodil/product-composite/state'
class DaffCompositeProductAppliedOptionsEntitiesAdapter<<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>>>  {
  getInitialState()
  getSelectors()
  upsertProducts(
    state: T
    ...products: DaffCompositeProduct[]
  ): T
  applyOption(
    state: T
    productId: string
    itemId: string
    optionId: string
    qty?: number
  )
}

Properties

Name Type Description
getInitialState

Gets the initial entity state.

getSelectors

Get the entity selectors.

upsertProducts T

Upserts the given composite products into state.

applyOption

Apply the specified option for the given composite product item.