GitHub

DaffProductCompositeRoutingConfig

An interface for providing @daffodil/product-composite/routing with necessary config values.

import { DaffProductCompositeRoutingConfig } from '@daffodil/product-composite/routing'
interface DaffProductCompositeRoutingConfig {
  compositeSelectionQueryParam: string
  compositeSelectionQueryParamDecode: (queryParam: string, product: DaffCompositeProduct) => DaffProductCompositeSelectionPayload
}

Properties

Name Type Description
compositeSelectionQueryParam string

The name of the query param for which a composite product page preselection can be defined. The value of this query param should be a DaffProductCompositeSelectionPayload after being base64 decoded and JSON parsed.

Defaults to composite_selection.

compositeSelectionQueryParamDecode (queryParam: string, product: DaffCompositeProduct) => DaffProductCompositeSelectionPayload

The function used to decode the value of the DaffProductCompositeStateConfig into a DaffProductCompositeSelectionPayload.

Defaults to (queryParam: string) => JSON.parse(atob(queryParam)).