ContextActions (Commerce Engine)
ContextActions (Commerce Engine)
|
|
Note
This component was introduced in version |
The context action creators.
See Dispatch Actions.
Loader Function
loadContextActions
Loads the commerce context reducer and returns the available context action creators.
Parameters
-
engine:
CommerceEngineThe commerce engine.
Returns ContextActionCreators: The context action creators.
ContextActionCreators
setContext
Sets the entire context.
Parameters
-
payload:
SetContextPayloadThe action creator payload.
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.
Related types
SetContextPayload
Properties
-
country:
string -
currency:
CurrencyCodeISO4217 -
language:
string -
view:
Pick<ViewParams, 'url'>