GitHub

DaffConfigurableProductAppliedAttributesEntitiesAdapter

import { DaffConfigurableProductAppliedAttributesEntitiesAdapter } from '@daffodil/product-configurable/state'

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

class DaffConfigurableProductAppliedAttributesEntitiesAdapter<<T extends EntityState<DaffConfigurableProductEntity> = EntityState<DaffConfigurableProductEntity>>>  {
  getInitialState(): EntityState<DaffConfigurableProductEntity>
  getSelectors(): EntitySelectors<DaffConfigurableProductEntity, EntityState<DaffConfigurableProductEntity>>
  upsertProducts(
    state: T
    ...products: DaffConfigurableProduct[]
  ): T
  applyAttribute(
    state: T
    productId: string
    attributeId: string
    attributeValue: string
  ): T
  removeAttribute(
    state: T
    productId: string
    attributeId: string
  ): T
  toggleAttribute(
    state: T
    productId: string
    attributeId: string
    attributeValue: string
  ): T
}