GitHub

DaffConfigurableProductAppliedAttributesEntitiesAdapter

Configurable Product Applied Attributes Adapter for changing/overwriting entity state.

import { DaffConfigurableProductAppliedAttributesEntitiesAdapter } from '@daffodil/product-configurable/state'
class DaffConfigurableProductAppliedAttributesEntitiesAdapter<<T extends EntityState<DaffConfigurableProductEntity> = EntityState<DaffConfigurableProductEntity>>>  {
  getInitialState()
  getSelectors()
  upsertProducts(
    state: T
    ...products: DaffConfigurableProduct[]
  ): T
  applyAttribute(
    state: T
    productId: string
    attributeId: string
    attributeValue: string
  )
  removeAttribute(
    state: T
    productId: string
    attributeId: string
  )
  toggleAttribute(
    state: T
    productId: string
    attributeId: string
    attributeValue: string
  )
}

Properties

Name Type Description
getInitialState
getSelectors
upsertProducts T

Upserts the given composite products into state.

applyAttribute

Apply the given attribute to the specified product in state.

removeAttribute

Remove the given attribute to the specified product in state.

toggleAttribute

Toggle the given attribute to the specified product in state.