ContextActions (Commerce Engine)
ContextActions (Commerce Engine)
This is for:
DeveloperIn this article
The context action creators.
See Dispatch Actions.
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
-
payload:
SetContextPayload
The 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'>