ContextActions (Commerce Engine)

This is for:

Developer

The context action creators.

Loader Function

loadContextActions

Loads the commerce context reducer and returns the available context action creators.

Parameters

  • engine: CommerceEngine

    The commerce engine.

Returns ContextActionCreators: The context action creators.

ContextActionCreators

setContext

Sets the entire context.

Parameters

Returns PayloadAction<SetContextPayload>: A dispatchable action.

setView

Sets the view context property without modifying any other context properties.

Parameters

  • payload: Pick<ViewParams, 'url'>

    The action creator payload.

Returns PayloadAction<SetViewPayload>: A dispatchable action.

SetContextPayload

Properties

  • country: string

  • currency: CurrencyCodeISO4217

  • language: string

  • view: Pick<ViewParams, 'url'>