Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Action } from '@ngrx/store';
  2.  
  3. import { LanguageCodes } from 'app/ui/models';
  4.  
  5. export const SET_DEFAULT_LOCALE: string = `[UI] Set Default Locale`;
  6. export const SET_CURRENT_LOCALE: string = `[UI] Set Current Locale`;
  7. export const SET_CURRENT_LOCALE_SUCCESS: string = `[UI] Set Current Locale Success`;
  8. export const SET_CURRENT_LOCALE_FAILURE: string = `[UI] Set Current Locale Failure`;
  9.  
  10. export class SetDefaultLocale implements Action {
  11.   readonly type: string = SET_DEFAULT_LOCALE;
  12.   constructor(public payload: { locale: LanguageCodes }) { }
  13. }
  14.  
  15. export class SetCurrentLocale implements Action {
  16.   readonly type: string = SET_CURRENT_LOCALE;
  17.   constructor(public payload: { locale: LanguageCodes }) { }
  18. }
  19.  
  20. export class SetCurrentLocaleSuccess implements Action {
  21.   readonly type: string = SET_CURRENT_LOCALE_SUCCESS;
  22.   constructor(public payload: { locale: LanguageCodes }) { }
  23. }
  24.  
  25. export class SetCurrentLocaleFailure implements Action {
  26.   readonly type: string = SET_CURRENT_LOCALE_FAILURE;
  27.   constructor(public payload: { error: Error }) { }
  28. }
  29.  
  30. export type ActionsUnion
  31.   = SetDefaultLocale
  32.   | SetCurrentLocale
  33.   | SetCurrentLocaleSuccess
  34.   | SetCurrentLocaleFailure;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement