You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UserStateResponse is type of Response with the type user-state, and will be used to tell the handler to update (current) user's state. Constructor accepts hash of properties to be set.
For example, SelectLanguage action can return this response, and user.state.locale will be set to en. The code of SelectLanguage.execute method may look like:
// ...returnnewUserStateResponse({locale: 'en'});
However, the code above is not a good practice. UserStateResponse is the base class for all state operations. For example, the line above can be rewritten to:
returnnewSelectLanguageResponse('en');
And SelectLanguageResponse extends UserStateResponse:
UserStateResponse
is type ofResponse
with the typeuser-state
, and will be used to tell the handler to update (current) user's state. Constructor accepts hash of properties to be set.For example,
SelectLanguage
action can return this response, anduser.state.locale
will be set toen
. The code ofSelectLanguage.execute
method may look like:However, the code above is not a good practice.
UserStateResponse
is the base class for all state operations. For example, the line above can be rewritten to:And
SelectLanguageResponse
extendsUserStateResponse
:The text was updated successfully, but these errors were encountered: